From ebd1f5a5a5c54db0f0109f368d3b54d36ba8bb41 Mon Sep 17 00:00:00 2001 From: szepeviktor Date: Mon, 4 Dec 2023 15:19:36 +0000 Subject: [PATCH] Upgrade client --- .gitignore | 9 + .openapi-generator/FILES | 358 + .openapi-generator/VERSION | 1 + .php-cs-fixer.dist.php | 29 + README.md | 269 +- composer.json | 38 + docs/Api/BankAccountApi.md | 325 + docs/Api/CurrencyApi.md | 74 + docs/Api/DocumentApi.md | 1380 +++ docs/Api/DocumentExportApi.md | 196 + docs/Api/InventoryApi.md | 70 + docs/Api/OrganizationApi.md | 67 + docs/Api/PartnerApi.md | 137 + docs/Api/ProductApi.md | 327 + docs/Api/SpendingApi.md | 341 + docs/Api/UtilApi.md | 193 + docs/Model/Address.md | 12 + docs/Model/BankAccount.md | 15 + docs/Model/BankAccountList.md | 15 + docs/Model/Category.md | 8 + docs/Model/CheckTaxNumberMessage.md | 8 + docs/Model/ClientError.md | 9 + docs/Model/ClientErrorResponse.md | 9 + docs/Model/ConversationRate.md | 12 + docs/Model/CorrectionType.md | 8 + docs/Model/Country.md | 8 + docs/Model/CreateDocumentExport.md | 21 + docs/Model/Currency.md | 8 + docs/Model/DateType.md | 8 + docs/Model/Discount.md | 10 + docs/Model/DiscountType.md | 8 + docs/Model/Document.md | 38 + docs/Model/DocumentAncestor.md | 10 + docs/Model/DocumentBankAccount.md | 13 + docs/Model/DocumentBlock.md | 14 + docs/Model/DocumentBlockList.md | 15 + docs/Model/DocumentBlockType.md | 8 + docs/Model/DocumentCancellation.md | 10 + docs/Model/DocumentExportFilterExtra.md | 17 + docs/Model/DocumentExportId.md | 9 + docs/Model/DocumentExportOtherOptions.md | 8 + docs/Model/DocumentExportQueryType.md | 8 + docs/Model/DocumentExportSortBy.md | 8 + docs/Model/DocumentExportStatus.md | 11 + docs/Model/DocumentExportStatusState.md | 8 + docs/Model/DocumentExportType.md | 8 + docs/Model/DocumentForm.md | 8 + docs/Model/DocumentFormat.md | 8 + docs/Model/DocumentInsert.md | 28 + .../DocumentInsertInstantPaymentRequest.md | 11 + docs/Model/DocumentInsertItemsInner.md | 18 + docs/Model/DocumentInsertType.md | 8 + docs/Model/DocumentInstantPaymentRequest.md | 11 + docs/Model/DocumentItem.md | 20 + docs/Model/DocumentItemData.md | 11 + docs/Model/DocumentLanguage.md | 8 + docs/Model/DocumentList.md | 15 + docs/Model/DocumentNotificationStatus.md | 8 + docs/Model/DocumentOrganization.md | 16 + docs/Model/DocumentPartner.md | 19 + docs/Model/DocumentPartnerPartnerShipping.md | 12 + docs/Model/DocumentProductData.md | 17 + docs/Model/DocumentPublicUrl.md | 9 + docs/Model/DocumentSettings.md | 20 + .../DocumentSettingsDontSendToNavReason.md | 8 + docs/Model/DocumentSummary.md | 14 + docs/Model/DocumentType.md | 8 + docs/Model/DocumentVatRateSummary.md | 14 + docs/Model/DontSendToNavReason.md | 8 + docs/Model/Entitlement.md | 8 + docs/Model/Feature.md | 8 + docs/Model/Id.md | 10 + docs/Model/InvoiceSettings.md | 13 + docs/Model/LedgerNumberInformation.md | 12 + docs/Model/ModificationDocumentInsert.md | 13 + docs/Model/Money.md | 10 + docs/Model/OnlinePayment.md | 8 + docs/Model/OnlineSzamlaStatus.md | 11 + docs/Model/OnlineSzamlaStatusEnum.md | 8 + docs/Model/OnlineSzamlaStatusMessage.md | 11 + docs/Model/OrganizationData.md | 10 + docs/Model/Partner.md | 25 + docs/Model/PartnerCustomBillingSettings.md | 14 + docs/Model/PartnerGiroSettings.md | 11 + docs/Model/PartnerList.md | 15 + docs/Model/PartnerPartnerShowType.md | 8 + docs/Model/PartnerShipping.md | 12 + docs/Model/PartnerShippingAddress.md | 12 + docs/Model/PartnerShowType.md | 8 + docs/Model/PartnerTaxType.md | 8 + docs/Model/PaymentHistory.md | 13 + docs/Model/PaymentMethod.md | 8 + docs/Model/PaymentStatus.md | 8 + docs/Model/PaymentStatusSpending.md | 8 + docs/Model/Product.md | 23 + docs/Model/ProductList.md | 15 + docs/Model/ProductQuantity.md | 9 + docs/Model/ReceiptInsert.md | 19 + docs/Model/ReceiptInsertItemsInner.md | 12 + docs/Model/ReceiptItemData.md | 9 + docs/Model/ReceiptProductData.md | 11 + docs/Model/Round.md | 8 + docs/Model/SendDocument.md | 9 + docs/Model/ServerError.md | 10 + docs/Model/ServerErrorResponse.md | 9 + docs/Model/ServerTime.md | 12 + docs/Model/ShippingMode.md | 8 + docs/Model/Source.md | 8 + docs/Model/Spending.md | 25 + docs/Model/SpendingList.md | 15 + docs/Model/SpendingListItem.md | 26 + docs/Model/SpendingPartner.md | 18 + docs/Model/SpendingPaymentMethod.md | 8 + docs/Model/SpendingSave.md | 23 + docs/Model/Subscription.md | 10 + docs/Model/SubscriptionErrorResponse.md | 9 + docs/Model/TaxNumber.md | 10 + docs/Model/TooManyRequestsResponse.md | 9 + docs/Model/UnitPriceType.md | 8 + docs/Model/ValidationError.md | 10 + docs/Model/ValidationErrorResponse.md | 10 + docs/Model/Vat.md | 8 + lib/Api/BankAccountApi.php | 2276 ++++ lib/Api/CurrencyApi.php | 607 + lib/Api/DocumentApi.php | 9889 +++++++++++++++++ lib/Api/DocumentExportApi.php | 1496 +++ lib/Api/InventoryApi.php | 593 + lib/Api/OrganizationApi.php | 550 + lib/Api/PartnerApi.php | 1052 ++ lib/Api/ProductApi.php | 2291 ++++ lib/Api/SpendingApi.php | 2399 ++++ lib/Api/UtilApi.php | 1434 +++ lib/ApiException.php | 120 + lib/Configuration.php | 532 + lib/HeaderSelector.php | 246 + lib/Model/Address.php | 524 + lib/Model/BankAccount.php | 625 ++ lib/Model/BankAccountList.php | 615 + lib/Model/Category.php | 78 + lib/Model/CheckTaxNumberMessage.php | 72 + lib/Model/ClientError.php | 410 + lib/Model/ClientErrorResponse.php | 410 + lib/Model/ConversationRate.php | 512 + lib/Model/CorrectionType.php | 114 + lib/Model/Country.php | 825 ++ lib/Model/CreateDocumentExport.php | 830 ++ lib/Model/Currency.php | 180 + lib/Model/DateType.php | 66 + lib/Model/Discount.php | 444 + lib/Model/DiscountType.php | 60 + lib/Model/Document.php | 1397 +++ lib/Model/DocumentAncestor.php | 445 + lib/Model/DocumentBankAccount.php | 559 + lib/Model/DocumentBlock.php | 580 + lib/Model/DocumentBlockList.php | 615 + lib/Model/DocumentBlockType.php | 78 + lib/Model/DocumentCancellation.php | 444 + lib/Model/DocumentExportFilterExtra.php | 682 ++ lib/Model/DocumentExportId.php | 410 + lib/Model/DocumentExportOtherOptions.php | 66 + lib/Model/DocumentExportQueryType.php | 63 + lib/Model/DocumentExportSortBy.php | 66 + lib/Model/DocumentExportStatus.php | 478 + lib/Model/DocumentExportStatusState.php | 72 + lib/Model/DocumentExportType.php | 132 + lib/Model/DocumentForm.php | 63 + lib/Model/DocumentFormat.php | 66 + lib/Model/DocumentInsert.php | 1087 ++ .../DocumentInsertInstantPaymentRequest.php | 478 + lib/Model/DocumentInsertItemsInner.php | 737 ++ lib/Model/DocumentInsertType.php | 69 + lib/Model/DocumentInstantPaymentRequest.php | 478 + lib/Model/DocumentItem.php | 791 ++ lib/Model/DocumentItemData.php | 484 + lib/Model/DocumentLanguage.php | 84 + lib/Model/DocumentList.php | 615 + lib/Model/DocumentNotificationStatus.php | 75 + lib/Model/DocumentOrganization.php | 648 ++ lib/Model/DocumentPartner.php | 757 ++ lib/Model/DocumentPartnerPartnerShipping.php | 519 + lib/Model/DocumentProductData.php | 700 ++ lib/Model/DocumentPublicUrl.php | 410 + lib/Model/DocumentSettings.php | 807 ++ .../DocumentSettingsDontSendToNavReason.php | 382 + lib/Model/DocumentSummary.php | 580 + lib/Model/DocumentType.php | 108 + lib/Model/DocumentVatRateSummary.php | 580 + lib/Model/DontSendToNavReason.php | 66 + lib/Model/Entitlement.php | 103 + lib/Model/Feature.php | 141 + lib/Model/Id.php | 444 + lib/Model/InvoiceSettings.php | 546 + lib/Model/LedgerNumberInformation.php | 512 + lib/Model/ModelInterface.php | 112 + lib/Model/ModificationDocumentInsert.php | 546 + lib/Model/Money.php | 444 + lib/Model/OnlinePayment.php | 69 + lib/Model/OnlineSzamlaStatus.php | 478 + lib/Model/OnlineSzamlaStatusEnum.php | 186 + lib/Model/OnlineSzamlaStatusMessage.php | 478 + lib/Model/OrganizationData.php | 444 + lib/Model/Partner.php | 982 ++ lib/Model/PartnerCustomBillingSettings.php | 580 + lib/Model/PartnerGiroSettings.php | 478 + lib/Model/PartnerList.php | 615 + lib/Model/PartnerPartnerShowType.php | 382 + lib/Model/PartnerShipping.php | 519 + lib/Model/PartnerShippingAddress.php | 524 + lib/Model/PartnerShowType.php | 66 + lib/Model/PartnerTaxType.php | 69 + lib/Model/PaymentHistory.php | 569 + lib/Model/PaymentMethod.php | 147 + lib/Model/PaymentStatus.php | 72 + lib/Model/PaymentStatusSpending.php | 66 + lib/Model/Product.php | 898 ++ lib/Model/ProductList.php | 615 + lib/Model/ProductQuantity.php | 410 + lib/Model/ReceiptInsert.php | 762 ++ lib/Model/ReceiptInsertItemsInner.php | 521 + lib/Model/ReceiptItemData.php | 413 + lib/Model/ReceiptProductData.php | 484 + lib/Model/Round.php | 69 + lib/Model/SendDocument.php | 410 + lib/Model/ServerError.php | 444 + lib/Model/ServerErrorResponse.php | 410 + lib/Model/ServerTime.php | 512 + lib/Model/ShippingMode.php | 66 + lib/Model/Source.php | 66 + lib/Model/Spending.php | 968 ++ lib/Model/SpendingList.php | 615 + lib/Model/SpendingListItem.php | 1002 ++ lib/Model/SpendingPartner.php | 716 ++ lib/Model/SpendingPaymentMethod.php | 147 + lib/Model/SpendingSave.php | 910 ++ lib/Model/Subscription.php | 444 + lib/Model/SubscriptionErrorResponse.php | 410 + lib/Model/TaxNumber.php | 444 + lib/Model/TooManyRequestsResponse.php | 410 + lib/Model/UnitPriceType.php | 63 + lib/Model/ValidationError.php | 444 + lib/Model/ValidationErrorResponse.php | 444 + lib/Model/Vat.php | 183 + lib/ObjectSerializer.php | 568 + phpunit.xml.dist | 18 + test/Api/BankAccountApiTest.php | 134 + test/Api/CurrencyApiTest.php | 86 + test/Api/DocumentApiTest.php | 326 + test/Api/DocumentExportApiTest.php | 110 + test/Api/InventoryApiTest.php | 86 + test/Api/OrganizationApiTest.php | 86 + test/Api/PartnerApiTest.php | 98 + test/Api/ProductApiTest.php | 134 + test/Api/SpendingApiTest.php | 134 + test/Api/UtilApiTest.php | 110 + test/Model/AddressTest.php | 118 + test/Model/BankAccountListTest.php | 145 + test/Model/BankAccountTest.php | 145 + test/Model/CategoryTest.php | 82 + test/Model/CheckTaxNumberMessageTest.php | 82 + test/Model/ClientErrorResponseTest.php | 91 + test/Model/ClientErrorTest.php | 91 + test/Model/ConversationRateTest.php | 118 + test/Model/CorrectionTypeTest.php | 82 + test/Model/CountryTest.php | 82 + test/Model/CreateDocumentExportTest.php | 199 + test/Model/CurrencyTest.php | 82 + test/Model/DateTypeTest.php | 82 + test/Model/DiscountTest.php | 100 + test/Model/DiscountTypeTest.php | 82 + test/Model/DocumentAncestorTest.php | 100 + test/Model/DocumentBankAccountTest.php | 127 + test/Model/DocumentBlockListTest.php | 145 + test/Model/DocumentBlockTest.php | 136 + test/Model/DocumentBlockTypeTest.php | 82 + test/Model/DocumentCancellationTest.php | 100 + test/Model/DocumentExportFilterExtraTest.php | 163 + test/Model/DocumentExportIdTest.php | 91 + test/Model/DocumentExportOtherOptionsTest.php | 82 + test/Model/DocumentExportQueryTypeTest.php | 82 + test/Model/DocumentExportSortByTest.php | 82 + test/Model/DocumentExportStatusStateTest.php | 82 + test/Model/DocumentExportStatusTest.php | 109 + test/Model/DocumentExportTypeTest.php | 82 + test/Model/DocumentFormTest.php | 82 + test/Model/DocumentFormatTest.php | 82 + ...ocumentInsertInstantPaymentRequestTest.php | 109 + test/Model/DocumentInsertItemsInnerTest.php | 172 + test/Model/DocumentInsertTest.php | 262 + test/Model/DocumentInsertTypeTest.php | 82 + .../DocumentInstantPaymentRequestTest.php | 109 + test/Model/DocumentItemDataTest.php | 109 + test/Model/DocumentItemTest.php | 190 + test/Model/DocumentLanguageTest.php | 82 + test/Model/DocumentListTest.php | 145 + test/Model/DocumentNotificationStatusTest.php | 82 + test/Model/DocumentOrganizationTest.php | 154 + .../DocumentPartnerPartnerShippingTest.php | 118 + test/Model/DocumentPartnerTest.php | 181 + test/Model/DocumentProductDataTest.php | 163 + test/Model/DocumentPublicUrlTest.php | 91 + ...ocumentSettingsDontSendToNavReasonTest.php | 82 + test/Model/DocumentSettingsTest.php | 190 + test/Model/DocumentSummaryTest.php | 136 + test/Model/DocumentTest.php | 352 + test/Model/DocumentTypeTest.php | 82 + test/Model/DocumentVatRateSummaryTest.php | 136 + test/Model/DontSendToNavReasonTest.php | 82 + test/Model/EntitlementTest.php | 82 + test/Model/FeatureTest.php | 82 + test/Model/IdTest.php | 100 + test/Model/InvoiceSettingsTest.php | 127 + test/Model/LedgerNumberInformationTest.php | 118 + test/Model/ModificationDocumentInsertTest.php | 127 + test/Model/MoneyTest.php | 100 + test/Model/OnlinePaymentTest.php | 82 + test/Model/OnlineSzamlaStatusEnumTest.php | 82 + test/Model/OnlineSzamlaStatusMessageTest.php | 109 + test/Model/OnlineSzamlaStatusTest.php | 109 + test/Model/OrganizationDataTest.php | 100 + .../PartnerCustomBillingSettingsTest.php | 136 + test/Model/PartnerGiroSettingsTest.php | 109 + test/Model/PartnerListTest.php | 145 + test/Model/PartnerPartnerShowTypeTest.php | 82 + test/Model/PartnerShippingAddressTest.php | 118 + test/Model/PartnerShippingTest.php | 118 + test/Model/PartnerShowTypeTest.php | 82 + test/Model/PartnerTaxTypeTest.php | 82 + test/Model/PartnerTest.php | 235 + test/Model/PaymentHistoryTest.php | 127 + test/Model/PaymentMethodTest.php | 82 + test/Model/PaymentStatusSpendingTest.php | 82 + test/Model/PaymentStatusTest.php | 82 + test/Model/ProductListTest.php | 145 + test/Model/ProductQuantityTest.php | 91 + test/Model/ProductTest.php | 217 + test/Model/ReceiptInsertItemsInnerTest.php | 118 + test/Model/ReceiptInsertTest.php | 181 + test/Model/ReceiptItemDataTest.php | 91 + test/Model/ReceiptProductDataTest.php | 109 + test/Model/RoundTest.php | 82 + test/Model/SendDocumentTest.php | 91 + test/Model/ServerErrorResponseTest.php | 91 + test/Model/ServerErrorTest.php | 100 + test/Model/ServerTimeTest.php | 118 + test/Model/ShippingModeTest.php | 82 + test/Model/SourceTest.php | 82 + test/Model/SpendingListItemTest.php | 244 + test/Model/SpendingListTest.php | 145 + test/Model/SpendingPartnerTest.php | 172 + test/Model/SpendingPaymentMethodTest.php | 82 + test/Model/SpendingSaveTest.php | 217 + test/Model/SpendingTest.php | 235 + test/Model/SubscriptionErrorResponseTest.php | 91 + test/Model/SubscriptionTest.php | 100 + test/Model/TaxNumberTest.php | 100 + test/Model/TooManyRequestsResponseTest.php | 91 + test/Model/UnitPriceTypeTest.php | 82 + test/Model/ValidationErrorResponseTest.php | 100 + test/Model/ValidationErrorTest.php | 100 + test/Model/VatTest.php | 82 + 360 files changed, 88195 insertions(+), 2 deletions(-) create mode 100644 .openapi-generator/FILES create mode 100644 .openapi-generator/VERSION create mode 100644 .php-cs-fixer.dist.php create mode 100644 composer.json create mode 100644 docs/Api/BankAccountApi.md create mode 100644 docs/Api/CurrencyApi.md create mode 100644 docs/Api/DocumentApi.md create mode 100644 docs/Api/DocumentExportApi.md create mode 100644 docs/Api/InventoryApi.md create mode 100644 docs/Api/OrganizationApi.md create mode 100644 docs/Api/PartnerApi.md create mode 100644 docs/Api/ProductApi.md create mode 100644 docs/Api/SpendingApi.md create mode 100644 docs/Api/UtilApi.md create mode 100644 docs/Model/Address.md create mode 100644 docs/Model/BankAccount.md create mode 100644 docs/Model/BankAccountList.md create mode 100644 docs/Model/Category.md create mode 100644 docs/Model/CheckTaxNumberMessage.md create mode 100644 docs/Model/ClientError.md create mode 100644 docs/Model/ClientErrorResponse.md create mode 100644 docs/Model/ConversationRate.md create mode 100644 docs/Model/CorrectionType.md create mode 100644 docs/Model/Country.md create mode 100644 docs/Model/CreateDocumentExport.md create mode 100644 docs/Model/Currency.md create mode 100644 docs/Model/DateType.md create mode 100644 docs/Model/Discount.md create mode 100644 docs/Model/DiscountType.md create mode 100644 docs/Model/Document.md create mode 100644 docs/Model/DocumentAncestor.md create mode 100644 docs/Model/DocumentBankAccount.md create mode 100644 docs/Model/DocumentBlock.md create mode 100644 docs/Model/DocumentBlockList.md create mode 100644 docs/Model/DocumentBlockType.md create mode 100644 docs/Model/DocumentCancellation.md create mode 100644 docs/Model/DocumentExportFilterExtra.md create mode 100644 docs/Model/DocumentExportId.md create mode 100644 docs/Model/DocumentExportOtherOptions.md create mode 100644 docs/Model/DocumentExportQueryType.md create mode 100644 docs/Model/DocumentExportSortBy.md create mode 100644 docs/Model/DocumentExportStatus.md create mode 100644 docs/Model/DocumentExportStatusState.md create mode 100644 docs/Model/DocumentExportType.md create mode 100644 docs/Model/DocumentForm.md create mode 100644 docs/Model/DocumentFormat.md create mode 100644 docs/Model/DocumentInsert.md create mode 100644 docs/Model/DocumentInsertInstantPaymentRequest.md create mode 100644 docs/Model/DocumentInsertItemsInner.md create mode 100644 docs/Model/DocumentInsertType.md create mode 100644 docs/Model/DocumentInstantPaymentRequest.md create mode 100644 docs/Model/DocumentItem.md create mode 100644 docs/Model/DocumentItemData.md create mode 100644 docs/Model/DocumentLanguage.md create mode 100644 docs/Model/DocumentList.md create mode 100644 docs/Model/DocumentNotificationStatus.md create mode 100644 docs/Model/DocumentOrganization.md create mode 100644 docs/Model/DocumentPartner.md create mode 100644 docs/Model/DocumentPartnerPartnerShipping.md create mode 100644 docs/Model/DocumentProductData.md create mode 100644 docs/Model/DocumentPublicUrl.md create mode 100644 docs/Model/DocumentSettings.md create mode 100644 docs/Model/DocumentSettingsDontSendToNavReason.md create mode 100644 docs/Model/DocumentSummary.md create mode 100644 docs/Model/DocumentType.md create mode 100644 docs/Model/DocumentVatRateSummary.md create mode 100644 docs/Model/DontSendToNavReason.md create mode 100644 docs/Model/Entitlement.md create mode 100644 docs/Model/Feature.md create mode 100644 docs/Model/Id.md create mode 100644 docs/Model/InvoiceSettings.md create mode 100644 docs/Model/LedgerNumberInformation.md create mode 100644 docs/Model/ModificationDocumentInsert.md create mode 100644 docs/Model/Money.md create mode 100644 docs/Model/OnlinePayment.md create mode 100644 docs/Model/OnlineSzamlaStatus.md create mode 100644 docs/Model/OnlineSzamlaStatusEnum.md create mode 100644 docs/Model/OnlineSzamlaStatusMessage.md create mode 100644 docs/Model/OrganizationData.md create mode 100644 docs/Model/Partner.md create mode 100644 docs/Model/PartnerCustomBillingSettings.md create mode 100644 docs/Model/PartnerGiroSettings.md create mode 100644 docs/Model/PartnerList.md create mode 100644 docs/Model/PartnerPartnerShowType.md create mode 100644 docs/Model/PartnerShipping.md create mode 100644 docs/Model/PartnerShippingAddress.md create mode 100644 docs/Model/PartnerShowType.md create mode 100644 docs/Model/PartnerTaxType.md create mode 100644 docs/Model/PaymentHistory.md create mode 100644 docs/Model/PaymentMethod.md create mode 100644 docs/Model/PaymentStatus.md create mode 100644 docs/Model/PaymentStatusSpending.md create mode 100644 docs/Model/Product.md create mode 100644 docs/Model/ProductList.md create mode 100644 docs/Model/ProductQuantity.md create mode 100644 docs/Model/ReceiptInsert.md create mode 100644 docs/Model/ReceiptInsertItemsInner.md create mode 100644 docs/Model/ReceiptItemData.md create mode 100644 docs/Model/ReceiptProductData.md create mode 100644 docs/Model/Round.md create mode 100644 docs/Model/SendDocument.md create mode 100644 docs/Model/ServerError.md create mode 100644 docs/Model/ServerErrorResponse.md create mode 100644 docs/Model/ServerTime.md create mode 100644 docs/Model/ShippingMode.md create mode 100644 docs/Model/Source.md create mode 100644 docs/Model/Spending.md create mode 100644 docs/Model/SpendingList.md create mode 100644 docs/Model/SpendingListItem.md create mode 100644 docs/Model/SpendingPartner.md create mode 100644 docs/Model/SpendingPaymentMethod.md create mode 100644 docs/Model/SpendingSave.md create mode 100644 docs/Model/Subscription.md create mode 100644 docs/Model/SubscriptionErrorResponse.md create mode 100644 docs/Model/TaxNumber.md create mode 100644 docs/Model/TooManyRequestsResponse.md create mode 100644 docs/Model/UnitPriceType.md create mode 100644 docs/Model/ValidationError.md create mode 100644 docs/Model/ValidationErrorResponse.md create mode 100644 docs/Model/Vat.md create mode 100644 lib/Api/BankAccountApi.php create mode 100644 lib/Api/CurrencyApi.php create mode 100644 lib/Api/DocumentApi.php create mode 100644 lib/Api/DocumentExportApi.php create mode 100644 lib/Api/InventoryApi.php create mode 100644 lib/Api/OrganizationApi.php create mode 100644 lib/Api/PartnerApi.php create mode 100644 lib/Api/ProductApi.php create mode 100644 lib/Api/SpendingApi.php create mode 100644 lib/Api/UtilApi.php create mode 100644 lib/ApiException.php create mode 100644 lib/Configuration.php create mode 100644 lib/HeaderSelector.php create mode 100644 lib/Model/Address.php create mode 100644 lib/Model/BankAccount.php create mode 100644 lib/Model/BankAccountList.php create mode 100644 lib/Model/Category.php create mode 100644 lib/Model/CheckTaxNumberMessage.php create mode 100644 lib/Model/ClientError.php create mode 100644 lib/Model/ClientErrorResponse.php create mode 100644 lib/Model/ConversationRate.php create mode 100644 lib/Model/CorrectionType.php create mode 100644 lib/Model/Country.php create mode 100644 lib/Model/CreateDocumentExport.php create mode 100644 lib/Model/Currency.php create mode 100644 lib/Model/DateType.php create mode 100644 lib/Model/Discount.php create mode 100644 lib/Model/DiscountType.php create mode 100644 lib/Model/Document.php create mode 100644 lib/Model/DocumentAncestor.php create mode 100644 lib/Model/DocumentBankAccount.php create mode 100644 lib/Model/DocumentBlock.php create mode 100644 lib/Model/DocumentBlockList.php create mode 100644 lib/Model/DocumentBlockType.php create mode 100644 lib/Model/DocumentCancellation.php create mode 100644 lib/Model/DocumentExportFilterExtra.php create mode 100644 lib/Model/DocumentExportId.php create mode 100644 lib/Model/DocumentExportOtherOptions.php create mode 100644 lib/Model/DocumentExportQueryType.php create mode 100644 lib/Model/DocumentExportSortBy.php create mode 100644 lib/Model/DocumentExportStatus.php create mode 100644 lib/Model/DocumentExportStatusState.php create mode 100644 lib/Model/DocumentExportType.php create mode 100644 lib/Model/DocumentForm.php create mode 100644 lib/Model/DocumentFormat.php create mode 100644 lib/Model/DocumentInsert.php create mode 100644 lib/Model/DocumentInsertInstantPaymentRequest.php create mode 100644 lib/Model/DocumentInsertItemsInner.php create mode 100644 lib/Model/DocumentInsertType.php create mode 100644 lib/Model/DocumentInstantPaymentRequest.php create mode 100644 lib/Model/DocumentItem.php create mode 100644 lib/Model/DocumentItemData.php create mode 100644 lib/Model/DocumentLanguage.php create mode 100644 lib/Model/DocumentList.php create mode 100644 lib/Model/DocumentNotificationStatus.php create mode 100644 lib/Model/DocumentOrganization.php create mode 100644 lib/Model/DocumentPartner.php create mode 100644 lib/Model/DocumentPartnerPartnerShipping.php create mode 100644 lib/Model/DocumentProductData.php create mode 100644 lib/Model/DocumentPublicUrl.php create mode 100644 lib/Model/DocumentSettings.php create mode 100644 lib/Model/DocumentSettingsDontSendToNavReason.php create mode 100644 lib/Model/DocumentSummary.php create mode 100644 lib/Model/DocumentType.php create mode 100644 lib/Model/DocumentVatRateSummary.php create mode 100644 lib/Model/DontSendToNavReason.php create mode 100644 lib/Model/Entitlement.php create mode 100644 lib/Model/Feature.php create mode 100644 lib/Model/Id.php create mode 100644 lib/Model/InvoiceSettings.php create mode 100644 lib/Model/LedgerNumberInformation.php create mode 100644 lib/Model/ModelInterface.php create mode 100644 lib/Model/ModificationDocumentInsert.php create mode 100644 lib/Model/Money.php create mode 100644 lib/Model/OnlinePayment.php create mode 100644 lib/Model/OnlineSzamlaStatus.php create mode 100644 lib/Model/OnlineSzamlaStatusEnum.php create mode 100644 lib/Model/OnlineSzamlaStatusMessage.php create mode 100644 lib/Model/OrganizationData.php create mode 100644 lib/Model/Partner.php create mode 100644 lib/Model/PartnerCustomBillingSettings.php create mode 100644 lib/Model/PartnerGiroSettings.php create mode 100644 lib/Model/PartnerList.php create mode 100644 lib/Model/PartnerPartnerShowType.php create mode 100644 lib/Model/PartnerShipping.php create mode 100644 lib/Model/PartnerShippingAddress.php create mode 100644 lib/Model/PartnerShowType.php create mode 100644 lib/Model/PartnerTaxType.php create mode 100644 lib/Model/PaymentHistory.php create mode 100644 lib/Model/PaymentMethod.php create mode 100644 lib/Model/PaymentStatus.php create mode 100644 lib/Model/PaymentStatusSpending.php create mode 100644 lib/Model/Product.php create mode 100644 lib/Model/ProductList.php create mode 100644 lib/Model/ProductQuantity.php create mode 100644 lib/Model/ReceiptInsert.php create mode 100644 lib/Model/ReceiptInsertItemsInner.php create mode 100644 lib/Model/ReceiptItemData.php create mode 100644 lib/Model/ReceiptProductData.php create mode 100644 lib/Model/Round.php create mode 100644 lib/Model/SendDocument.php create mode 100644 lib/Model/ServerError.php create mode 100644 lib/Model/ServerErrorResponse.php create mode 100644 lib/Model/ServerTime.php create mode 100644 lib/Model/ShippingMode.php create mode 100644 lib/Model/Source.php create mode 100644 lib/Model/Spending.php create mode 100644 lib/Model/SpendingList.php create mode 100644 lib/Model/SpendingListItem.php create mode 100644 lib/Model/SpendingPartner.php create mode 100644 lib/Model/SpendingPaymentMethod.php create mode 100644 lib/Model/SpendingSave.php create mode 100644 lib/Model/Subscription.php create mode 100644 lib/Model/SubscriptionErrorResponse.php create mode 100644 lib/Model/TaxNumber.php create mode 100644 lib/Model/TooManyRequestsResponse.php create mode 100644 lib/Model/UnitPriceType.php create mode 100644 lib/Model/ValidationError.php create mode 100644 lib/Model/ValidationErrorResponse.php create mode 100644 lib/Model/Vat.php create mode 100644 lib/ObjectSerializer.php create mode 100644 phpunit.xml.dist create mode 100644 test/Api/BankAccountApiTest.php create mode 100644 test/Api/CurrencyApiTest.php create mode 100644 test/Api/DocumentApiTest.php create mode 100644 test/Api/DocumentExportApiTest.php create mode 100644 test/Api/InventoryApiTest.php create mode 100644 test/Api/OrganizationApiTest.php create mode 100644 test/Api/PartnerApiTest.php create mode 100644 test/Api/ProductApiTest.php create mode 100644 test/Api/SpendingApiTest.php create mode 100644 test/Api/UtilApiTest.php create mode 100644 test/Model/AddressTest.php create mode 100644 test/Model/BankAccountListTest.php create mode 100644 test/Model/BankAccountTest.php create mode 100644 test/Model/CategoryTest.php create mode 100644 test/Model/CheckTaxNumberMessageTest.php create mode 100644 test/Model/ClientErrorResponseTest.php create mode 100644 test/Model/ClientErrorTest.php create mode 100644 test/Model/ConversationRateTest.php create mode 100644 test/Model/CorrectionTypeTest.php create mode 100644 test/Model/CountryTest.php create mode 100644 test/Model/CreateDocumentExportTest.php create mode 100644 test/Model/CurrencyTest.php create mode 100644 test/Model/DateTypeTest.php create mode 100644 test/Model/DiscountTest.php create mode 100644 test/Model/DiscountTypeTest.php create mode 100644 test/Model/DocumentAncestorTest.php create mode 100644 test/Model/DocumentBankAccountTest.php create mode 100644 test/Model/DocumentBlockListTest.php create mode 100644 test/Model/DocumentBlockTest.php create mode 100644 test/Model/DocumentBlockTypeTest.php create mode 100644 test/Model/DocumentCancellationTest.php create mode 100644 test/Model/DocumentExportFilterExtraTest.php create mode 100644 test/Model/DocumentExportIdTest.php create mode 100644 test/Model/DocumentExportOtherOptionsTest.php create mode 100644 test/Model/DocumentExportQueryTypeTest.php create mode 100644 test/Model/DocumentExportSortByTest.php create mode 100644 test/Model/DocumentExportStatusStateTest.php create mode 100644 test/Model/DocumentExportStatusTest.php create mode 100644 test/Model/DocumentExportTypeTest.php create mode 100644 test/Model/DocumentFormTest.php create mode 100644 test/Model/DocumentFormatTest.php create mode 100644 test/Model/DocumentInsertInstantPaymentRequestTest.php create mode 100644 test/Model/DocumentInsertItemsInnerTest.php create mode 100644 test/Model/DocumentInsertTest.php create mode 100644 test/Model/DocumentInsertTypeTest.php create mode 100644 test/Model/DocumentInstantPaymentRequestTest.php create mode 100644 test/Model/DocumentItemDataTest.php create mode 100644 test/Model/DocumentItemTest.php create mode 100644 test/Model/DocumentLanguageTest.php create mode 100644 test/Model/DocumentListTest.php create mode 100644 test/Model/DocumentNotificationStatusTest.php create mode 100644 test/Model/DocumentOrganizationTest.php create mode 100644 test/Model/DocumentPartnerPartnerShippingTest.php create mode 100644 test/Model/DocumentPartnerTest.php create mode 100644 test/Model/DocumentProductDataTest.php create mode 100644 test/Model/DocumentPublicUrlTest.php create mode 100644 test/Model/DocumentSettingsDontSendToNavReasonTest.php create mode 100644 test/Model/DocumentSettingsTest.php create mode 100644 test/Model/DocumentSummaryTest.php create mode 100644 test/Model/DocumentTest.php create mode 100644 test/Model/DocumentTypeTest.php create mode 100644 test/Model/DocumentVatRateSummaryTest.php create mode 100644 test/Model/DontSendToNavReasonTest.php create mode 100644 test/Model/EntitlementTest.php create mode 100644 test/Model/FeatureTest.php create mode 100644 test/Model/IdTest.php create mode 100644 test/Model/InvoiceSettingsTest.php create mode 100644 test/Model/LedgerNumberInformationTest.php create mode 100644 test/Model/ModificationDocumentInsertTest.php create mode 100644 test/Model/MoneyTest.php create mode 100644 test/Model/OnlinePaymentTest.php create mode 100644 test/Model/OnlineSzamlaStatusEnumTest.php create mode 100644 test/Model/OnlineSzamlaStatusMessageTest.php create mode 100644 test/Model/OnlineSzamlaStatusTest.php create mode 100644 test/Model/OrganizationDataTest.php create mode 100644 test/Model/PartnerCustomBillingSettingsTest.php create mode 100644 test/Model/PartnerGiroSettingsTest.php create mode 100644 test/Model/PartnerListTest.php create mode 100644 test/Model/PartnerPartnerShowTypeTest.php create mode 100644 test/Model/PartnerShippingAddressTest.php create mode 100644 test/Model/PartnerShippingTest.php create mode 100644 test/Model/PartnerShowTypeTest.php create mode 100644 test/Model/PartnerTaxTypeTest.php create mode 100644 test/Model/PartnerTest.php create mode 100644 test/Model/PaymentHistoryTest.php create mode 100644 test/Model/PaymentMethodTest.php create mode 100644 test/Model/PaymentStatusSpendingTest.php create mode 100644 test/Model/PaymentStatusTest.php create mode 100644 test/Model/ProductListTest.php create mode 100644 test/Model/ProductQuantityTest.php create mode 100644 test/Model/ProductTest.php create mode 100644 test/Model/ReceiptInsertItemsInnerTest.php create mode 100644 test/Model/ReceiptInsertTest.php create mode 100644 test/Model/ReceiptItemDataTest.php create mode 100644 test/Model/ReceiptProductDataTest.php create mode 100644 test/Model/RoundTest.php create mode 100644 test/Model/SendDocumentTest.php create mode 100644 test/Model/ServerErrorResponseTest.php create mode 100644 test/Model/ServerErrorTest.php create mode 100644 test/Model/ServerTimeTest.php create mode 100644 test/Model/ShippingModeTest.php create mode 100644 test/Model/SourceTest.php create mode 100644 test/Model/SpendingListItemTest.php create mode 100644 test/Model/SpendingListTest.php create mode 100644 test/Model/SpendingPartnerTest.php create mode 100644 test/Model/SpendingPaymentMethodTest.php create mode 100644 test/Model/SpendingSaveTest.php create mode 100644 test/Model/SpendingTest.php create mode 100644 test/Model/SubscriptionErrorResponseTest.php create mode 100644 test/Model/SubscriptionTest.php create mode 100644 test/Model/TaxNumberTest.php create mode 100644 test/Model/TooManyRequestsResponseTest.php create mode 100644 test/Model/UnitPriceTypeTest.php create mode 100644 test/Model/ValidationErrorResponseTest.php create mode 100644 test/Model/ValidationErrorTest.php create mode 100644 test/Model/VatTest.php diff --git a/.gitignore b/.gitignore index a67d42b..9f1681c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,15 @@ +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + composer.phar /vendor/ # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file # composer.lock + +# php-cs-fixer cache +.php_cs.cache +.php-cs-fixer.cache + +# PHPUnit cache +.phpunit.result.cache diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..5e6a377 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,358 @@ +.gitignore +.php-cs-fixer.dist.php +README.md +composer.json +docs/Api/BankAccountApi.md +docs/Api/CurrencyApi.md +docs/Api/DocumentApi.md +docs/Api/DocumentExportApi.md +docs/Api/InventoryApi.md +docs/Api/OrganizationApi.md +docs/Api/PartnerApi.md +docs/Api/ProductApi.md +docs/Api/SpendingApi.md +docs/Api/UtilApi.md +docs/Model/Address.md +docs/Model/BankAccount.md +docs/Model/BankAccountList.md +docs/Model/Category.md +docs/Model/CheckTaxNumberMessage.md +docs/Model/ClientError.md +docs/Model/ClientErrorResponse.md +docs/Model/ConversationRate.md +docs/Model/CorrectionType.md +docs/Model/Country.md +docs/Model/CreateDocumentExport.md +docs/Model/Currency.md +docs/Model/DateType.md +docs/Model/Discount.md +docs/Model/DiscountType.md +docs/Model/Document.md +docs/Model/DocumentAncestor.md +docs/Model/DocumentBankAccount.md +docs/Model/DocumentBlock.md +docs/Model/DocumentBlockList.md +docs/Model/DocumentBlockType.md +docs/Model/DocumentCancellation.md +docs/Model/DocumentExportFilterExtra.md +docs/Model/DocumentExportId.md +docs/Model/DocumentExportOtherOptions.md +docs/Model/DocumentExportQueryType.md +docs/Model/DocumentExportSortBy.md +docs/Model/DocumentExportStatus.md +docs/Model/DocumentExportStatusState.md +docs/Model/DocumentExportType.md +docs/Model/DocumentForm.md +docs/Model/DocumentFormat.md +docs/Model/DocumentInsert.md +docs/Model/DocumentInsertInstantPaymentRequest.md +docs/Model/DocumentInsertItemsInner.md +docs/Model/DocumentInsertType.md +docs/Model/DocumentInstantPaymentRequest.md +docs/Model/DocumentItem.md +docs/Model/DocumentItemData.md +docs/Model/DocumentLanguage.md +docs/Model/DocumentList.md +docs/Model/DocumentNotificationStatus.md +docs/Model/DocumentOrganization.md +docs/Model/DocumentPartner.md +docs/Model/DocumentPartnerPartnerShipping.md +docs/Model/DocumentProductData.md +docs/Model/DocumentPublicUrl.md +docs/Model/DocumentSettings.md +docs/Model/DocumentSettingsDontSendToNavReason.md +docs/Model/DocumentSummary.md +docs/Model/DocumentType.md +docs/Model/DocumentVatRateSummary.md +docs/Model/DontSendToNavReason.md +docs/Model/Entitlement.md +docs/Model/Feature.md +docs/Model/Id.md +docs/Model/InvoiceSettings.md +docs/Model/LedgerNumberInformation.md +docs/Model/ModificationDocumentInsert.md +docs/Model/Money.md +docs/Model/OnlinePayment.md +docs/Model/OnlineSzamlaStatus.md +docs/Model/OnlineSzamlaStatusEnum.md +docs/Model/OnlineSzamlaStatusMessage.md +docs/Model/OrganizationData.md +docs/Model/Partner.md +docs/Model/PartnerCustomBillingSettings.md +docs/Model/PartnerGiroSettings.md +docs/Model/PartnerList.md +docs/Model/PartnerPartnerShowType.md +docs/Model/PartnerShipping.md +docs/Model/PartnerShippingAddress.md +docs/Model/PartnerShowType.md +docs/Model/PartnerTaxType.md +docs/Model/PaymentHistory.md +docs/Model/PaymentMethod.md +docs/Model/PaymentStatus.md +docs/Model/PaymentStatusSpending.md +docs/Model/Product.md +docs/Model/ProductList.md +docs/Model/ProductQuantity.md +docs/Model/ReceiptInsert.md +docs/Model/ReceiptInsertItemsInner.md +docs/Model/ReceiptItemData.md +docs/Model/ReceiptProductData.md +docs/Model/Round.md +docs/Model/SendDocument.md +docs/Model/ServerError.md +docs/Model/ServerErrorResponse.md +docs/Model/ServerTime.md +docs/Model/ShippingMode.md +docs/Model/Source.md +docs/Model/Spending.md +docs/Model/SpendingList.md +docs/Model/SpendingListItem.md +docs/Model/SpendingPartner.md +docs/Model/SpendingPaymentMethod.md +docs/Model/SpendingSave.md +docs/Model/Subscription.md +docs/Model/SubscriptionErrorResponse.md +docs/Model/TaxNumber.md +docs/Model/TooManyRequestsResponse.md +docs/Model/UnitPriceType.md +docs/Model/ValidationError.md +docs/Model/ValidationErrorResponse.md +docs/Model/Vat.md +lib/Api/BankAccountApi.php +lib/Api/CurrencyApi.php +lib/Api/DocumentApi.php +lib/Api/DocumentExportApi.php +lib/Api/InventoryApi.php +lib/Api/OrganizationApi.php +lib/Api/PartnerApi.php +lib/Api/ProductApi.php +lib/Api/SpendingApi.php +lib/Api/UtilApi.php +lib/ApiException.php +lib/Configuration.php +lib/HeaderSelector.php +lib/Model/Address.php +lib/Model/BankAccount.php +lib/Model/BankAccountList.php +lib/Model/Category.php +lib/Model/CheckTaxNumberMessage.php +lib/Model/ClientError.php +lib/Model/ClientErrorResponse.php +lib/Model/ConversationRate.php +lib/Model/CorrectionType.php +lib/Model/Country.php +lib/Model/CreateDocumentExport.php +lib/Model/Currency.php +lib/Model/DateType.php +lib/Model/Discount.php +lib/Model/DiscountType.php +lib/Model/Document.php +lib/Model/DocumentAncestor.php +lib/Model/DocumentBankAccount.php +lib/Model/DocumentBlock.php +lib/Model/DocumentBlockList.php +lib/Model/DocumentBlockType.php +lib/Model/DocumentCancellation.php +lib/Model/DocumentExportFilterExtra.php +lib/Model/DocumentExportId.php +lib/Model/DocumentExportOtherOptions.php +lib/Model/DocumentExportQueryType.php +lib/Model/DocumentExportSortBy.php +lib/Model/DocumentExportStatus.php +lib/Model/DocumentExportStatusState.php +lib/Model/DocumentExportType.php +lib/Model/DocumentForm.php +lib/Model/DocumentFormat.php +lib/Model/DocumentInsert.php +lib/Model/DocumentInsertInstantPaymentRequest.php +lib/Model/DocumentInsertItemsInner.php +lib/Model/DocumentInsertType.php +lib/Model/DocumentInstantPaymentRequest.php +lib/Model/DocumentItem.php +lib/Model/DocumentItemData.php +lib/Model/DocumentLanguage.php +lib/Model/DocumentList.php +lib/Model/DocumentNotificationStatus.php +lib/Model/DocumentOrganization.php +lib/Model/DocumentPartner.php +lib/Model/DocumentPartnerPartnerShipping.php +lib/Model/DocumentProductData.php +lib/Model/DocumentPublicUrl.php +lib/Model/DocumentSettings.php +lib/Model/DocumentSettingsDontSendToNavReason.php +lib/Model/DocumentSummary.php +lib/Model/DocumentType.php +lib/Model/DocumentVatRateSummary.php +lib/Model/DontSendToNavReason.php +lib/Model/Entitlement.php +lib/Model/Feature.php +lib/Model/Id.php +lib/Model/InvoiceSettings.php +lib/Model/LedgerNumberInformation.php +lib/Model/ModelInterface.php +lib/Model/ModificationDocumentInsert.php +lib/Model/Money.php +lib/Model/OnlinePayment.php +lib/Model/OnlineSzamlaStatus.php +lib/Model/OnlineSzamlaStatusEnum.php +lib/Model/OnlineSzamlaStatusMessage.php +lib/Model/OrganizationData.php +lib/Model/Partner.php +lib/Model/PartnerCustomBillingSettings.php +lib/Model/PartnerGiroSettings.php +lib/Model/PartnerList.php +lib/Model/PartnerPartnerShowType.php +lib/Model/PartnerShipping.php +lib/Model/PartnerShippingAddress.php +lib/Model/PartnerShowType.php +lib/Model/PartnerTaxType.php +lib/Model/PaymentHistory.php +lib/Model/PaymentMethod.php +lib/Model/PaymentStatus.php +lib/Model/PaymentStatusSpending.php +lib/Model/Product.php +lib/Model/ProductList.php +lib/Model/ProductQuantity.php +lib/Model/ReceiptInsert.php +lib/Model/ReceiptInsertItemsInner.php +lib/Model/ReceiptItemData.php +lib/Model/ReceiptProductData.php +lib/Model/Round.php +lib/Model/SendDocument.php +lib/Model/ServerError.php +lib/Model/ServerErrorResponse.php +lib/Model/ServerTime.php +lib/Model/ShippingMode.php +lib/Model/Source.php +lib/Model/Spending.php +lib/Model/SpendingList.php +lib/Model/SpendingListItem.php +lib/Model/SpendingPartner.php +lib/Model/SpendingPaymentMethod.php +lib/Model/SpendingSave.php +lib/Model/Subscription.php +lib/Model/SubscriptionErrorResponse.php +lib/Model/TaxNumber.php +lib/Model/TooManyRequestsResponse.php +lib/Model/UnitPriceType.php +lib/Model/ValidationError.php +lib/Model/ValidationErrorResponse.php +lib/Model/Vat.php +lib/ObjectSerializer.php +phpunit.xml.dist +test/Api/BankAccountApiTest.php +test/Api/CurrencyApiTest.php +test/Api/DocumentApiTest.php +test/Api/DocumentExportApiTest.php +test/Api/InventoryApiTest.php +test/Api/OrganizationApiTest.php +test/Api/PartnerApiTest.php +test/Api/ProductApiTest.php +test/Api/SpendingApiTest.php +test/Api/UtilApiTest.php +test/Model/AddressTest.php +test/Model/BankAccountListTest.php +test/Model/BankAccountTest.php +test/Model/CategoryTest.php +test/Model/CheckTaxNumberMessageTest.php +test/Model/ClientErrorResponseTest.php +test/Model/ClientErrorTest.php +test/Model/ConversationRateTest.php +test/Model/CorrectionTypeTest.php +test/Model/CountryTest.php +test/Model/CreateDocumentExportTest.php +test/Model/CurrencyTest.php +test/Model/DateTypeTest.php +test/Model/DiscountTest.php +test/Model/DiscountTypeTest.php +test/Model/DocumentAncestorTest.php +test/Model/DocumentBankAccountTest.php +test/Model/DocumentBlockListTest.php +test/Model/DocumentBlockTest.php +test/Model/DocumentBlockTypeTest.php +test/Model/DocumentCancellationTest.php +test/Model/DocumentExportFilterExtraTest.php +test/Model/DocumentExportIdTest.php +test/Model/DocumentExportOtherOptionsTest.php +test/Model/DocumentExportQueryTypeTest.php +test/Model/DocumentExportSortByTest.php +test/Model/DocumentExportStatusStateTest.php +test/Model/DocumentExportStatusTest.php +test/Model/DocumentExportTypeTest.php +test/Model/DocumentFormTest.php +test/Model/DocumentFormatTest.php +test/Model/DocumentInsertInstantPaymentRequestTest.php +test/Model/DocumentInsertItemsInnerTest.php +test/Model/DocumentInsertTest.php +test/Model/DocumentInsertTypeTest.php +test/Model/DocumentInstantPaymentRequestTest.php +test/Model/DocumentItemDataTest.php +test/Model/DocumentItemTest.php +test/Model/DocumentLanguageTest.php +test/Model/DocumentListTest.php +test/Model/DocumentNotificationStatusTest.php +test/Model/DocumentOrganizationTest.php +test/Model/DocumentPartnerPartnerShippingTest.php +test/Model/DocumentPartnerTest.php +test/Model/DocumentProductDataTest.php +test/Model/DocumentPublicUrlTest.php +test/Model/DocumentSettingsDontSendToNavReasonTest.php +test/Model/DocumentSettingsTest.php +test/Model/DocumentSummaryTest.php +test/Model/DocumentTest.php +test/Model/DocumentTypeTest.php +test/Model/DocumentVatRateSummaryTest.php +test/Model/DontSendToNavReasonTest.php +test/Model/EntitlementTest.php +test/Model/FeatureTest.php +test/Model/IdTest.php +test/Model/InvoiceSettingsTest.php +test/Model/LedgerNumberInformationTest.php +test/Model/ModificationDocumentInsertTest.php +test/Model/MoneyTest.php +test/Model/OnlinePaymentTest.php +test/Model/OnlineSzamlaStatusEnumTest.php +test/Model/OnlineSzamlaStatusMessageTest.php +test/Model/OnlineSzamlaStatusTest.php +test/Model/OrganizationDataTest.php +test/Model/PartnerCustomBillingSettingsTest.php +test/Model/PartnerGiroSettingsTest.php +test/Model/PartnerListTest.php +test/Model/PartnerPartnerShowTypeTest.php +test/Model/PartnerShippingAddressTest.php +test/Model/PartnerShippingTest.php +test/Model/PartnerShowTypeTest.php +test/Model/PartnerTaxTypeTest.php +test/Model/PartnerTest.php +test/Model/PaymentHistoryTest.php +test/Model/PaymentMethodTest.php +test/Model/PaymentStatusSpendingTest.php +test/Model/PaymentStatusTest.php +test/Model/ProductListTest.php +test/Model/ProductQuantityTest.php +test/Model/ProductTest.php +test/Model/ReceiptInsertItemsInnerTest.php +test/Model/ReceiptInsertTest.php +test/Model/ReceiptItemDataTest.php +test/Model/ReceiptProductDataTest.php +test/Model/RoundTest.php +test/Model/SendDocumentTest.php +test/Model/ServerErrorResponseTest.php +test/Model/ServerErrorTest.php +test/Model/ServerTimeTest.php +test/Model/ShippingModeTest.php +test/Model/SourceTest.php +test/Model/SpendingListItemTest.php +test/Model/SpendingListTest.php +test/Model/SpendingPartnerTest.php +test/Model/SpendingPaymentMethodTest.php +test/Model/SpendingSaveTest.php +test/Model/SpendingTest.php +test/Model/SubscriptionErrorResponseTest.php +test/Model/SubscriptionTest.php +test/Model/TaxNumberTest.php +test/Model/TooManyRequestsResponseTest.php +test/Model/UnitPriceTypeTest.php +test/Model/ValidationErrorResponseTest.php +test/Model/ValidationErrorTest.php +test/Model/VatTest.php diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..cd802a1 --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..af9cf39 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,29 @@ +in(__DIR__) + ->exclude('vendor') + ->exclude('test') + ->exclude('tests') +; + +$config = new PhpCsFixer\Config(); +return $config->setRules([ + '@PSR12' => true, + 'phpdoc_order' => true, + 'array_syntax' => [ 'syntax' => 'short' ], + 'strict_comparison' => true, + 'strict_param' => true, + 'no_trailing_whitespace' => false, + 'no_trailing_whitespace_in_comment' => false, + 'braces' => false, + 'single_blank_line_at_eof' => false, + 'blank_line_after_namespace' => false, + 'no_leading_import_slash' => false, + ]) + ->setFinder($finder) +; diff --git a/README.md b/README.md index eddc1c9..60f9add 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,267 @@ -# billingo-php -Billingo PHP SDK. +# OpenAPIClient-php + +This is a Billingo API v3 documentation. Our API based on REST software architectural style. API has resource-oriented URLs, accepts JSON-encoded request bodies and returns JSON-encoded responses. To use this API you have to generate a new API key on our [site](https://app.billingo.hu/api-key). After that, you can test your API key on this page. + +For more information, please visit [https://www.billingo.hu/kapcsolat](https://www.billingo.hu/kapcsolat). + +## Installation & Usage + +### Requirements + +PHP 7.4 and later. +Should also work with PHP 8.0. + +### Composer + +To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: + +```json +{ + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" + } + ], + "require": { + "GIT_USER_ID/GIT_REPO_ID": "*@dev" + } +} +``` + +Then run `composer install` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\BankAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$bank_account = new \Cone\Billingo\Model\BankAccount(); // \Cone\Billingo\Model\BankAccount | BankAccount object that you would like to store. + +try { + $result = $apiInstance->createBankAccount($bank_account); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BankAccountApi->createBankAccount: ', $e->getMessage(), PHP_EOL; +} + +``` + +## API Endpoints + +All URIs are relative to *https://api.billingo.hu/v3* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*BankAccountApi* | [**createBankAccount**](docs/Api/BankAccountApi.md#createbankaccount) | **POST** /bank-accounts | Create a bank account +*BankAccountApi* | [**deleteBankAccount**](docs/Api/BankAccountApi.md#deletebankaccount) | **DELETE** /bank-accounts/{id} | Delete a bank account +*BankAccountApi* | [**getBankAccount**](docs/Api/BankAccountApi.md#getbankaccount) | **GET** /bank-accounts/{id} | Retrieve a bank account +*BankAccountApi* | [**listBankAccount**](docs/Api/BankAccountApi.md#listbankaccount) | **GET** /bank-accounts | List all bank account +*BankAccountApi* | [**updateBankAccount**](docs/Api/BankAccountApi.md#updatebankaccount) | **PUT** /bank-accounts/{id} | Update a bank account +*CurrencyApi* | [**getConversionRate**](docs/Api/CurrencyApi.md#getconversionrate) | **GET** /currencies | Get currencies exchange rate. +*DocumentApi* | [**archiveDocument**](docs/Api/DocumentApi.md#archivedocument) | **PUT** /documents/{id}/archive | Archive a proforma document. +*DocumentApi* | [**cancelDocument**](docs/Api/DocumentApi.md#canceldocument) | **POST** /documents/{id}/cancel | Cancel a document +*DocumentApi* | [**createDocument**](docs/Api/DocumentApi.md#createdocument) | **POST** /documents | Create a document +*DocumentApi* | [**createDocumentFromDraft**](docs/Api/DocumentApi.md#createdocumentfromdraft) | **PUT** /documents/{id} | Converts a draft to an invoice. +*DocumentApi* | [**createDocumentFromProforma**](docs/Api/DocumentApi.md#createdocumentfromproforma) | **POST** /documents/{id}/create-from-proforma | Create a document from proforma. +*DocumentApi* | [**createModificationDocument**](docs/Api/DocumentApi.md#createmodificationdocument) | **POST** /documents/{id}/create-modification-document | Create a modification document. +*DocumentApi* | [**createReceipt**](docs/Api/DocumentApi.md#createreceipt) | **POST** /documents/receipt | Create a receipt +*DocumentApi* | [**createReceiptFromDraft**](docs/Api/DocumentApi.md#createreceiptfromdraft) | **PUT** /documents/receipt/{id} | Converts a draft to a receipt. +*DocumentApi* | [**deleteDocument**](docs/Api/DocumentApi.md#deletedocument) | **DELETE** /documents/{id} | Delete a draft. +*DocumentApi* | [**deletePayment**](docs/Api/DocumentApi.md#deletepayment) | **DELETE** /documents/{id}/payments | Delete all payment history on document +*DocumentApi* | [**documentCopy**](docs/Api/DocumentApi.md#documentcopy) | **POST** /documents/{id}/copy | Copy a document +*DocumentApi* | [**downloadDocument**](docs/Api/DocumentApi.md#downloaddocument) | **GET** /documents/{id}/download | Download a document in PDF format. +*DocumentApi* | [**getDocument**](docs/Api/DocumentApi.md#getdocument) | **GET** /documents/{id} | Retrieve a document +*DocumentApi* | [**getDocumentByVendorId**](docs/Api/DocumentApi.md#getdocumentbyvendorid) | **GET** /documents/vendor/{vendor_id} | Retrieve a document by vendor id +*DocumentApi* | [**getOnlineSzamlaStatus**](docs/Api/DocumentApi.md#getonlineszamlastatus) | **GET** /documents/{id}/online-szamla | Retrieve a document Online Számla status +*DocumentApi* | [**getPayment**](docs/Api/DocumentApi.md#getpayment) | **GET** /documents/{id}/payments | Retrieve a payment histroy +*DocumentApi* | [**getPublicUrl**](docs/Api/DocumentApi.md#getpublicurl) | **GET** /documents/{id}/public-url | Retrieve a document download public url. +*DocumentApi* | [**listDocument**](docs/Api/DocumentApi.md#listdocument) | **GET** /documents | List all documents +*DocumentApi* | [**posPrint**](docs/Api/DocumentApi.md#posprint) | **GET** /documents/{id}/print/pos | Returns a printable POS PDF +*DocumentApi* | [**sendDocument**](docs/Api/DocumentApi.md#senddocument) | **POST** /documents/{id}/send | Send invoice to given email adresses. +*DocumentApi* | [**updatePayment**](docs/Api/DocumentApi.md#updatepayment) | **PUT** /documents/{id}/payments | Update payment history +*DocumentExportApi* | [**create**](docs/Api/DocumentExportApi.md#create) | **POST** /document-export | Create document export. +*DocumentExportApi* | [**download**](docs/Api/DocumentExportApi.md#download) | **GET** /document-export/{id}/download | Return exported binary file. +*DocumentExportApi* | [**poll**](docs/Api/DocumentExportApi.md#poll) | **GET** /document-export/{id}/poll | Retrieve export state. +*InventoryApi* | [**getProductQuantity**](docs/Api/InventoryApi.md#getproductquantity) | **GET** /inventory/product/{id}/quantity | Retrieve product quantity +*OrganizationApi* | [**getOrganizationData**](docs/Api/OrganizationApi.md#getorganizationdata) | **GET** /organization | Retrieve a organization data. +*PartnerApi* | [**createPartner**](docs/Api/PartnerApi.md#createpartner) | **POST** /partners | Create a partner +*PartnerApi* | [**listPartner**](docs/Api/PartnerApi.md#listpartner) | **GET** /partners | List all partners +*ProductApi* | [**createProduct**](docs/Api/ProductApi.md#createproduct) | **POST** /products | Create a product +*ProductApi* | [**deleteProduct**](docs/Api/ProductApi.md#deleteproduct) | **DELETE** /products/{id} | Delete a product +*ProductApi* | [**getProduct**](docs/Api/ProductApi.md#getproduct) | **GET** /products/{id} | Retrieve a product +*ProductApi* | [**listProduct**](docs/Api/ProductApi.md#listproduct) | **GET** /products | List all product +*ProductApi* | [**updateProduct**](docs/Api/ProductApi.md#updateproduct) | **PUT** /products/{id} | Update a product +*SpendingApi* | [**spendingDelete**](docs/Api/SpendingApi.md#spendingdelete) | **DELETE** /spendings/{id} | Deletes a spending. +*SpendingApi* | [**spendingList**](docs/Api/SpendingApi.md#spendinglist) | **GET** /spendings | Lists all spending +*SpendingApi* | [**spendingSave**](docs/Api/SpendingApi.md#spendingsave) | **POST** /spendings | Creates a new spending. +*SpendingApi* | [**spendingShow**](docs/Api/SpendingApi.md#spendingshow) | **GET** /spendings/{id} | Retrieves one specific spending. +*SpendingApi* | [**spendingUpdate**](docs/Api/SpendingApi.md#spendingupdate) | **PUT** /spendings/{id} | Updates a spending item. +*UtilApi* | [**checkTaxNumber**](docs/Api/UtilApi.md#checktaxnumber) | **GET** /utils/check-tax-number/{tax_number} | Check tax number. +*UtilApi* | [**getId**](docs/Api/UtilApi.md#getid) | **GET** /utils/convert-legacy-id/{id} | Convert legacy ID to v3 ID. +*UtilApi* | [**getServerTime**](docs/Api/UtilApi.md#getservertime) | **GET** /utils/time | Get the server time + +## Models + +- [Address](docs/Model/Address.md) +- [BankAccount](docs/Model/BankAccount.md) +- [BankAccountList](docs/Model/BankAccountList.md) +- [Category](docs/Model/Category.md) +- [CheckTaxNumberMessage](docs/Model/CheckTaxNumberMessage.md) +- [ClientError](docs/Model/ClientError.md) +- [ClientErrorResponse](docs/Model/ClientErrorResponse.md) +- [ConversationRate](docs/Model/ConversationRate.md) +- [CorrectionType](docs/Model/CorrectionType.md) +- [Country](docs/Model/Country.md) +- [CreateDocumentExport](docs/Model/CreateDocumentExport.md) +- [Currency](docs/Model/Currency.md) +- [DateType](docs/Model/DateType.md) +- [Discount](docs/Model/Discount.md) +- [DiscountType](docs/Model/DiscountType.md) +- [Document](docs/Model/Document.md) +- [DocumentAncestor](docs/Model/DocumentAncestor.md) +- [DocumentBankAccount](docs/Model/DocumentBankAccount.md) +- [DocumentBlock](docs/Model/DocumentBlock.md) +- [DocumentBlockList](docs/Model/DocumentBlockList.md) +- [DocumentBlockType](docs/Model/DocumentBlockType.md) +- [DocumentCancellation](docs/Model/DocumentCancellation.md) +- [DocumentExportFilterExtra](docs/Model/DocumentExportFilterExtra.md) +- [DocumentExportId](docs/Model/DocumentExportId.md) +- [DocumentExportOtherOptions](docs/Model/DocumentExportOtherOptions.md) +- [DocumentExportQueryType](docs/Model/DocumentExportQueryType.md) +- [DocumentExportSortBy](docs/Model/DocumentExportSortBy.md) +- [DocumentExportStatus](docs/Model/DocumentExportStatus.md) +- [DocumentExportStatusState](docs/Model/DocumentExportStatusState.md) +- [DocumentExportType](docs/Model/DocumentExportType.md) +- [DocumentForm](docs/Model/DocumentForm.md) +- [DocumentFormat](docs/Model/DocumentFormat.md) +- [DocumentInsert](docs/Model/DocumentInsert.md) +- [DocumentInsertInstantPaymentRequest](docs/Model/DocumentInsertInstantPaymentRequest.md) +- [DocumentInsertItemsInner](docs/Model/DocumentInsertItemsInner.md) +- [DocumentInsertType](docs/Model/DocumentInsertType.md) +- [DocumentInstantPaymentRequest](docs/Model/DocumentInstantPaymentRequest.md) +- [DocumentItem](docs/Model/DocumentItem.md) +- [DocumentItemData](docs/Model/DocumentItemData.md) +- [DocumentLanguage](docs/Model/DocumentLanguage.md) +- [DocumentList](docs/Model/DocumentList.md) +- [DocumentNotificationStatus](docs/Model/DocumentNotificationStatus.md) +- [DocumentOrganization](docs/Model/DocumentOrganization.md) +- [DocumentPartner](docs/Model/DocumentPartner.md) +- [DocumentPartnerPartnerShipping](docs/Model/DocumentPartnerPartnerShipping.md) +- [DocumentProductData](docs/Model/DocumentProductData.md) +- [DocumentPublicUrl](docs/Model/DocumentPublicUrl.md) +- [DocumentSettings](docs/Model/DocumentSettings.md) +- [DocumentSettingsDontSendToNavReason](docs/Model/DocumentSettingsDontSendToNavReason.md) +- [DocumentSummary](docs/Model/DocumentSummary.md) +- [DocumentType](docs/Model/DocumentType.md) +- [DocumentVatRateSummary](docs/Model/DocumentVatRateSummary.md) +- [DontSendToNavReason](docs/Model/DontSendToNavReason.md) +- [Entitlement](docs/Model/Entitlement.md) +- [Feature](docs/Model/Feature.md) +- [Id](docs/Model/Id.md) +- [InvoiceSettings](docs/Model/InvoiceSettings.md) +- [LedgerNumberInformation](docs/Model/LedgerNumberInformation.md) +- [ModificationDocumentInsert](docs/Model/ModificationDocumentInsert.md) +- [Money](docs/Model/Money.md) +- [OnlinePayment](docs/Model/OnlinePayment.md) +- [OnlineSzamlaStatus](docs/Model/OnlineSzamlaStatus.md) +- [OnlineSzamlaStatusEnum](docs/Model/OnlineSzamlaStatusEnum.md) +- [OnlineSzamlaStatusMessage](docs/Model/OnlineSzamlaStatusMessage.md) +- [OrganizationData](docs/Model/OrganizationData.md) +- [Partner](docs/Model/Partner.md) +- [PartnerCustomBillingSettings](docs/Model/PartnerCustomBillingSettings.md) +- [PartnerGiroSettings](docs/Model/PartnerGiroSettings.md) +- [PartnerList](docs/Model/PartnerList.md) +- [PartnerPartnerShowType](docs/Model/PartnerPartnerShowType.md) +- [PartnerShipping](docs/Model/PartnerShipping.md) +- [PartnerShippingAddress](docs/Model/PartnerShippingAddress.md) +- [PartnerShowType](docs/Model/PartnerShowType.md) +- [PartnerTaxType](docs/Model/PartnerTaxType.md) +- [PaymentHistory](docs/Model/PaymentHistory.md) +- [PaymentMethod](docs/Model/PaymentMethod.md) +- [PaymentStatus](docs/Model/PaymentStatus.md) +- [PaymentStatusSpending](docs/Model/PaymentStatusSpending.md) +- [Product](docs/Model/Product.md) +- [ProductList](docs/Model/ProductList.md) +- [ProductQuantity](docs/Model/ProductQuantity.md) +- [ReceiptInsert](docs/Model/ReceiptInsert.md) +- [ReceiptInsertItemsInner](docs/Model/ReceiptInsertItemsInner.md) +- [ReceiptItemData](docs/Model/ReceiptItemData.md) +- [ReceiptProductData](docs/Model/ReceiptProductData.md) +- [Round](docs/Model/Round.md) +- [SendDocument](docs/Model/SendDocument.md) +- [ServerError](docs/Model/ServerError.md) +- [ServerErrorResponse](docs/Model/ServerErrorResponse.md) +- [ServerTime](docs/Model/ServerTime.md) +- [ShippingMode](docs/Model/ShippingMode.md) +- [Source](docs/Model/Source.md) +- [Spending](docs/Model/Spending.md) +- [SpendingList](docs/Model/SpendingList.md) +- [SpendingListItem](docs/Model/SpendingListItem.md) +- [SpendingPartner](docs/Model/SpendingPartner.md) +- [SpendingPaymentMethod](docs/Model/SpendingPaymentMethod.md) +- [SpendingSave](docs/Model/SpendingSave.md) +- [Subscription](docs/Model/Subscription.md) +- [SubscriptionErrorResponse](docs/Model/SubscriptionErrorResponse.md) +- [TaxNumber](docs/Model/TaxNumber.md) +- [TooManyRequestsResponse](docs/Model/TooManyRequestsResponse.md) +- [UnitPriceType](docs/Model/UnitPriceType.md) +- [ValidationError](docs/Model/ValidationError.md) +- [ValidationErrorResponse](docs/Model/ValidationErrorResponse.md) +- [Vat](docs/Model/Vat.md) + +## Authorization + +Authentication schemes defined for the API: +### api_key + +- **Type**: API key +- **API key parameter name**: X-API-KEY +- **Location**: HTTP header + + +## Tests + +To run the tests, use: + +```bash +composer install +vendor/bin/phpunit +``` + +## Author + +hello@billingo.hu + +## About this package + +This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `3.0.15` +- Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..79e7241 --- /dev/null +++ b/composer.json @@ -0,0 +1,38 @@ +{ + "description": "This is a Billingo API v3 documentation. Our API based on REST software architectural style. API has resource-oriented URLs, accepts JSON-encoded request bodies and returns JSON-encoded responses. To use this API you have to generate a new API key on our [site](https://app.billingo.hu/api-key). After that, you can test your API key on this page.", + "keywords": [ + "openapitools", + "openapi-generator", + "openapi", + "php", + "sdk", + "rest", + "api" + ], + "homepage": "https://openapi-generator.tech", + "license": "unlicense", + "authors": [ + { + "name": "OpenAPI-Generator contributors", + "homepage": "https://openapi-generator.tech" + } + ], + "require": { + "php": "^7.4 || ^8.0", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^7.3", + "guzzlehttp/psr7": "^1.7 || ^2.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0 || ^9.0", + "friendsofphp/php-cs-fixer": "^3.5" + }, + "autoload": { + "psr-4": { "Cone\\Billingo\\" : "lib/" } + }, + "autoload-dev": { + "psr-4": { "Cone\\Billingo\\Test\\" : "test/" } + } +} diff --git a/docs/Api/BankAccountApi.md b/docs/Api/BankAccountApi.md new file mode 100644 index 0000000..5558152 --- /dev/null +++ b/docs/Api/BankAccountApi.md @@ -0,0 +1,325 @@ +# Cone\Billingo\BankAccountApi + +All URIs are relative to https://api.billingo.hu/v3, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createBankAccount()**](BankAccountApi.md#createBankAccount) | **POST** /bank-accounts | Create a bank account | +| [**deleteBankAccount()**](BankAccountApi.md#deleteBankAccount) | **DELETE** /bank-accounts/{id} | Delete a bank account | +| [**getBankAccount()**](BankAccountApi.md#getBankAccount) | **GET** /bank-accounts/{id} | Retrieve a bank account | +| [**listBankAccount()**](BankAccountApi.md#listBankAccount) | **GET** /bank-accounts | List all bank account | +| [**updateBankAccount()**](BankAccountApi.md#updateBankAccount) | **PUT** /bank-accounts/{id} | Update a bank account | + + +## `createBankAccount()` + +```php +createBankAccount($bank_account): \Cone\Billingo\Model\BankAccount +``` + +Create a bank account + +Create a new bank account. Returns a bank account object if the create is succeded. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\BankAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$bank_account = new \Cone\Billingo\Model\BankAccount(); // \Cone\Billingo\Model\BankAccount | BankAccount object that you would like to store. + +try { + $result = $apiInstance->createBankAccount($bank_account); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BankAccountApi->createBankAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **bank_account** | [**\Cone\Billingo\Model\BankAccount**](../Model/BankAccount.md)| BankAccount object that you would like to store. | | + +### Return type + +[**\Cone\Billingo\Model\BankAccount**](../Model/BankAccount.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteBankAccount()` + +```php +deleteBankAccount($id) +``` + +Delete a bank account + +Delete an existing bank account. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\BankAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $apiInstance->deleteBankAccount($id); +} catch (Exception $e) { + echo 'Exception when calling BankAccountApi->deleteBankAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getBankAccount()` + +```php +getBankAccount($id): \Cone\Billingo\Model\BankAccount +``` + +Retrieve a bank account + +Retrieves the details of an existing bank account. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\BankAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $result = $apiInstance->getBankAccount($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BankAccountApi->getBankAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +[**\Cone\Billingo\Model\BankAccount**](../Model/BankAccount.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listBankAccount()` + +```php +listBankAccount($page, $per_page): \Cone\Billingo\Model\BankAccountList +``` + +List all bank account + +Returns a list of your bank accounts. The bank accounts are returned sorted by creation date, with the most recent bank account appearing first. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\BankAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$page = 56; // int +$per_page = 25; // int + +try { + $result = $apiInstance->listBankAccount($page, $per_page); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BankAccountApi->listBankAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **page** | **int**| | [optional] | +| **per_page** | **int**| | [optional] [default to 25] | + +### Return type + +[**\Cone\Billingo\Model\BankAccountList**](../Model/BankAccountList.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateBankAccount()` + +```php +updateBankAccount($id, $bank_account): \Cone\Billingo\Model\BankAccount +``` + +Update a bank account + +Update an existing bank accounts. Returns a bank account object if the update is succeded. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\BankAccountApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int +$bank_account = new \Cone\Billingo\Model\BankAccount(); // \Cone\Billingo\Model\BankAccount | Bank account object that you would like to update. + +try { + $result = $apiInstance->updateBankAccount($id, $bank_account); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BankAccountApi->updateBankAccount: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | +| **bank_account** | [**\Cone\Billingo\Model\BankAccount**](../Model/BankAccount.md)| Bank account object that you would like to update. | | + +### Return type + +[**\Cone\Billingo\Model\BankAccount**](../Model/BankAccount.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/CurrencyApi.md b/docs/Api/CurrencyApi.md new file mode 100644 index 0000000..2db63c5 --- /dev/null +++ b/docs/Api/CurrencyApi.md @@ -0,0 +1,74 @@ +# Cone\Billingo\CurrencyApi + +All URIs are relative to https://api.billingo.hu/v3, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getConversionRate()**](CurrencyApi.md#getConversionRate) | **GET** /currencies | Get currencies exchange rate. | + + +## `getConversionRate()` + +```php +getConversionRate($from, $to, $date): \Cone\Billingo\Model\ConversationRate +``` + +Get currencies exchange rate. + +Return with the exchange value of given currencies. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\CurrencyApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$from = new \Cone\Billingo\Model\Currency(); // Currency +$to = new \Cone\Billingo\Model\Currency(); // Currency +$date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime + +try { + $result = $apiInstance->getConversionRate($from, $to, $date); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CurrencyApi->getConversionRate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **from** | [**Currency**](../Model/.md)| | | +| **to** | [**Currency**](../Model/.md)| | | +| **date** | **\DateTime**| | [optional] | + +### Return type + +[**\Cone\Billingo\Model\ConversationRate**](../Model/ConversationRate.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/DocumentApi.md b/docs/Api/DocumentApi.md new file mode 100644 index 0000000..27bda15 --- /dev/null +++ b/docs/Api/DocumentApi.md @@ -0,0 +1,1380 @@ +# Cone\Billingo\DocumentApi + +All URIs are relative to https://api.billingo.hu/v3, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveDocument()**](DocumentApi.md#archiveDocument) | **PUT** /documents/{id}/archive | Archive a proforma document. | +| [**cancelDocument()**](DocumentApi.md#cancelDocument) | **POST** /documents/{id}/cancel | Cancel a document | +| [**createDocument()**](DocumentApi.md#createDocument) | **POST** /documents | Create a document | +| [**createDocumentFromDraft()**](DocumentApi.md#createDocumentFromDraft) | **PUT** /documents/{id} | Converts a draft to an invoice. | +| [**createDocumentFromProforma()**](DocumentApi.md#createDocumentFromProforma) | **POST** /documents/{id}/create-from-proforma | Create a document from proforma. | +| [**createModificationDocument()**](DocumentApi.md#createModificationDocument) | **POST** /documents/{id}/create-modification-document | Create a modification document. | +| [**createReceipt()**](DocumentApi.md#createReceipt) | **POST** /documents/receipt | Create a receipt | +| [**createReceiptFromDraft()**](DocumentApi.md#createReceiptFromDraft) | **PUT** /documents/receipt/{id} | Converts a draft to a receipt. | +| [**deleteDocument()**](DocumentApi.md#deleteDocument) | **DELETE** /documents/{id} | Delete a draft. | +| [**deletePayment()**](DocumentApi.md#deletePayment) | **DELETE** /documents/{id}/payments | Delete all payment history on document | +| [**documentCopy()**](DocumentApi.md#documentCopy) | **POST** /documents/{id}/copy | Copy a document | +| [**downloadDocument()**](DocumentApi.md#downloadDocument) | **GET** /documents/{id}/download | Download a document in PDF format. | +| [**getDocument()**](DocumentApi.md#getDocument) | **GET** /documents/{id} | Retrieve a document | +| [**getDocumentByVendorId()**](DocumentApi.md#getDocumentByVendorId) | **GET** /documents/vendor/{vendor_id} | Retrieve a document by vendor id | +| [**getOnlineSzamlaStatus()**](DocumentApi.md#getOnlineSzamlaStatus) | **GET** /documents/{id}/online-szamla | Retrieve a document Online Számla status | +| [**getPayment()**](DocumentApi.md#getPayment) | **GET** /documents/{id}/payments | Retrieve a payment histroy | +| [**getPublicUrl()**](DocumentApi.md#getPublicUrl) | **GET** /documents/{id}/public-url | Retrieve a document download public url. | +| [**listDocument()**](DocumentApi.md#listDocument) | **GET** /documents | List all documents | +| [**posPrint()**](DocumentApi.md#posPrint) | **GET** /documents/{id}/print/pos | Returns a printable POS PDF | +| [**sendDocument()**](DocumentApi.md#sendDocument) | **POST** /documents/{id}/send | Send invoice to given email adresses. | +| [**updatePayment()**](DocumentApi.md#updatePayment) | **PUT** /documents/{id}/payments | Update payment history | + + +## `archiveDocument()` + +```php +archiveDocument($id) +``` + +Archive a proforma document. + +Archive an existing proforma document. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $apiInstance->archiveDocument($id); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->archiveDocument: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `cancelDocument()` + +```php +cancelDocument($id, $document_cancellation): \Cone\Billingo\Model\Document +``` + +Cancel a document + +Cancel a document. Returns a cancellation document object if the cancellation is succeded. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int +$document_cancellation = new \Cone\Billingo\Model\DocumentCancellation(); // \Cone\Billingo\Model\DocumentCancellation | Comment and notifiable email addresses - comma separated for multiple email addresses + +try { + $result = $apiInstance->cancelDocument($id, $document_cancellation); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->cancelDocument: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | +| **document_cancellation** | [**\Cone\Billingo\Model\DocumentCancellation**](../Model/DocumentCancellation.md)| Comment and notifiable email addresses - comma separated for multiple email addresses | [optional] | + +### Return type + +[**\Cone\Billingo\Model\Document**](../Model/Document.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createDocument()` + +```php +createDocument($document_insert): \Cone\Billingo\Model\Document +``` + +Create a document + +Create a new document. Returns a document object if the create is succeded. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$document_insert = new \Cone\Billingo\Model\DocumentInsert(); // \Cone\Billingo\Model\DocumentInsert | DocumentInsert object that you would like to store. + +try { + $result = $apiInstance->createDocument($document_insert); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->createDocument: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **document_insert** | [**\Cone\Billingo\Model\DocumentInsert**](../Model/DocumentInsert.md)| DocumentInsert object that you would like to store. | | + +### Return type + +[**\Cone\Billingo\Model\Document**](../Model/Document.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createDocumentFromDraft()` + +```php +createDocumentFromDraft($id, $document_insert): \Cone\Billingo\Model\Document +``` + +Converts a draft to an invoice. + +Converts a draft to an invoice. Returns the invoice object if the convert is succeded. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int +$document_insert = new \Cone\Billingo\Model\DocumentInsert(); // \Cone\Billingo\Model\DocumentInsert | DocumentInsert object that you would like to store. + +try { + $result = $apiInstance->createDocumentFromDraft($id, $document_insert); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->createDocumentFromDraft: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | +| **document_insert** | [**\Cone\Billingo\Model\DocumentInsert**](../Model/DocumentInsert.md)| DocumentInsert object that you would like to store. | | + +### Return type + +[**\Cone\Billingo\Model\Document**](../Model/Document.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createDocumentFromProforma()` + +```php +createDocumentFromProforma($id, $invoice_settings): \Cone\Billingo\Model\Document +``` + +Create a document from proforma. + +Create a new document from proforma. Returns a document object if the create is succeded. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int +$invoice_settings = new \Cone\Billingo\Model\InvoiceSettings(); // \Cone\Billingo\Model\InvoiceSettings | InvoiceSettings object. + +try { + $result = $apiInstance->createDocumentFromProforma($id, $invoice_settings); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->createDocumentFromProforma: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | +| **invoice_settings** | [**\Cone\Billingo\Model\InvoiceSettings**](../Model/InvoiceSettings.md)| InvoiceSettings object. | [optional] | + +### Return type + +[**\Cone\Billingo\Model\Document**](../Model/Document.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createModificationDocument()` + +```php +createModificationDocument($id, $modification_document_insert): \Cone\Billingo\Model\Document +``` + +Create a modification document. + +Create a modification document for the given document. Returns a new document object if the create is successful. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int +$modification_document_insert = new \Cone\Billingo\Model\ModificationDocumentInsert(); // \Cone\Billingo\Model\ModificationDocumentInsert | ModificationDocumentInsert object that you would like to store. + +try { + $result = $apiInstance->createModificationDocument($id, $modification_document_insert); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->createModificationDocument: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | +| **modification_document_insert** | [**\Cone\Billingo\Model\ModificationDocumentInsert**](../Model/ModificationDocumentInsert.md)| ModificationDocumentInsert object that you would like to store. | | + +### Return type + +[**\Cone\Billingo\Model\Document**](../Model/Document.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createReceipt()` + +```php +createReceipt($receipt_insert): \Cone\Billingo\Model\Document +``` + +Create a receipt + +Create a new receipt. Returns a document object if the create is succeded. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$receipt_insert = new \Cone\Billingo\Model\ReceiptInsert(); // \Cone\Billingo\Model\ReceiptInsert | ReceiptInsert object that you would like to store. + +try { + $result = $apiInstance->createReceipt($receipt_insert); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->createReceipt: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **receipt_insert** | [**\Cone\Billingo\Model\ReceiptInsert**](../Model/ReceiptInsert.md)| ReceiptInsert object that you would like to store. | | + +### Return type + +[**\Cone\Billingo\Model\Document**](../Model/Document.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createReceiptFromDraft()` + +```php +createReceiptFromDraft($id, $receipt_insert): \Cone\Billingo\Model\Document +``` + +Converts a draft to a receipt. + +Converts a draft to a receipt. Returns the receipt object if the convert is succeded. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int +$receipt_insert = new \Cone\Billingo\Model\ReceiptInsert(); // \Cone\Billingo\Model\ReceiptInsert | ReceiptInsert object that you would like to store. + +try { + $result = $apiInstance->createReceiptFromDraft($id, $receipt_insert); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->createReceiptFromDraft: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | +| **receipt_insert** | [**\Cone\Billingo\Model\ReceiptInsert**](../Model/ReceiptInsert.md)| ReceiptInsert object that you would like to store. | | + +### Return type + +[**\Cone\Billingo\Model\Document**](../Model/Document.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteDocument()` + +```php +deleteDocument($id) +``` + +Delete a draft. + +Delete an existing draft. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $apiInstance->deleteDocument($id); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->deleteDocument: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deletePayment()` + +```php +deletePayment($id): \Cone\Billingo\Model\PaymentHistory[] +``` + +Delete all payment history on document + +Delete all exist payment history on document. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $result = $apiInstance->deletePayment($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->deletePayment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +[**\Cone\Billingo\Model\PaymentHistory[]**](../Model/PaymentHistory.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `documentCopy()` + +```php +documentCopy($id): \Cone\Billingo\Model\Document +``` + +Copy a document + +Copy a document. Returns the new document if the copy was succeded. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $result = $apiInstance->documentCopy($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->documentCopy: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +[**\Cone\Billingo\Model\Document**](../Model/Document.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `downloadDocument()` + +```php +downloadDocument($id): \SplFileObject +``` + +Download a document in PDF format. + +Download a document. Returns a document in PDF format. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $result = $apiInstance->downloadDocument($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->downloadDocument: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +**\SplFileObject** + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/pdf`, `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDocument()` + +```php +getDocument($id): \Cone\Billingo\Model\Document +``` + +Retrieve a document + +Retrieves the details of an existing document. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $result = $apiInstance->getDocument($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->getDocument: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +[**\Cone\Billingo\Model\Document**](../Model/Document.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDocumentByVendorId()` + +```php +getDocumentByVendorId($vendor_id): \Cone\Billingo\Model\Document +``` + +Retrieve a document by vendor id + +Retrieves the details of an existing document by vendor id. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$vendor_id = 'vendor_id_example'; // string + +try { + $result = $apiInstance->getDocumentByVendorId($vendor_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->getDocumentByVendorId: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **vendor_id** | **string**| | | + +### Return type + +[**\Cone\Billingo\Model\Document**](../Model/Document.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getOnlineSzamlaStatus()` + +```php +getOnlineSzamlaStatus($id): \Cone\Billingo\Model\OnlineSzamlaStatus +``` + +Retrieve a document Online Számla status + +Retrieves the details of an existing document status. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $result = $apiInstance->getOnlineSzamlaStatus($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->getOnlineSzamlaStatus: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +[**\Cone\Billingo\Model\OnlineSzamlaStatus**](../Model/OnlineSzamlaStatus.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPayment()` + +```php +getPayment($id): \Cone\Billingo\Model\PaymentHistory[] +``` + +Retrieve a payment histroy + +Retrieves the details of payment history an existing document. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $result = $apiInstance->getPayment($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->getPayment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +[**\Cone\Billingo\Model\PaymentHistory[]**](../Model/PaymentHistory.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getPublicUrl()` + +```php +getPublicUrl($id): \Cone\Billingo\Model\DocumentPublicUrl +``` + +Retrieve a document download public url. + +Retrieves public url to download an existing document. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $result = $apiInstance->getPublicUrl($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->getPublicUrl: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +[**\Cone\Billingo\Model\DocumentPublicUrl**](../Model/DocumentPublicUrl.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listDocument()` + +```php +listDocument($page, $per_page, $block_id, $partner_id, $payment_method, $payment_status, $start_date, $end_date, $start_number, $end_number, $start_year, $end_year, $type, $query, $paid_start_date, $paid_end_date, $fulfillment_start_date, $fulfillment_end_date, $last_modified_date): \Cone\Billingo\Model\DocumentList +``` + +List all documents + +Returns a list of your documents. The documents are returned sorted by creation date, with the most recent documents appearing first. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$page = 56; // int +$per_page = 25; // int +$block_id = 56; // int | Filter documents by the identifier of your DocumentBlock. +$partner_id = 56; // int | Filter documents by the identifier of your Partner. +$payment_method = cash; // PaymentMethod | Filter documents by PaymentMethod value. +$payment_status = paid; // PaymentStatus | Filter documents by PaymentStatus value. +$start_date = 2020-05-15; // \DateTime | Filter documents by their invoice date. +$end_date = 2020-05-15; // \DateTime | Filter documents by their invoice date. +$start_number = 1; // int | Starting number of the document, should not contain year or any other formatting. Required if `start_year` given +$end_number = 10; // int | Ending number of the document, should not contain year or any other formatting. Required if `end_year` given +$start_year = 2020; // int | Year for `start_number` parameter. Required if `start_number` given. +$end_year = 2020; // int | Year for `end_number` parameter. Required if `end_number` given. +$type = invoice; // DocumentType | Filter documents by type +$query = 'query_example'; // string | Filter documents by the given text +$paid_start_date = 2020-05-15; // \DateTime | Filter documents by their payment date. +$paid_end_date = 2020-05-15; // \DateTime | Filter documents by their payment date. +$fulfillment_start_date = 2020-05-15; // \DateTime | Filter documents by their fulfillment date. +$fulfillment_end_date = 2020-05-15; // \DateTime | Filter documents by their fulfillment date. +$last_modified_date = 2021-09-03 11:27:00; // string | Filter documents by their last modified date. + +try { + $result = $apiInstance->listDocument($page, $per_page, $block_id, $partner_id, $payment_method, $payment_status, $start_date, $end_date, $start_number, $end_number, $start_year, $end_year, $type, $query, $paid_start_date, $paid_end_date, $fulfillment_start_date, $fulfillment_end_date, $last_modified_date); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->listDocument: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **page** | **int**| | [optional] | +| **per_page** | **int**| | [optional] [default to 25] | +| **block_id** | **int**| Filter documents by the identifier of your DocumentBlock. | [optional] | +| **partner_id** | **int**| Filter documents by the identifier of your Partner. | [optional] | +| **payment_method** | [**PaymentMethod**](../Model/.md)| Filter documents by PaymentMethod value. | [optional] | +| **payment_status** | [**PaymentStatus**](../Model/.md)| Filter documents by PaymentStatus value. | [optional] | +| **start_date** | **\DateTime**| Filter documents by their invoice date. | [optional] | +| **end_date** | **\DateTime**| Filter documents by their invoice date. | [optional] | +| **start_number** | **int**| Starting number of the document, should not contain year or any other formatting. Required if `start_year` given | [optional] | +| **end_number** | **int**| Ending number of the document, should not contain year or any other formatting. Required if `end_year` given | [optional] | +| **start_year** | **int**| Year for `start_number` parameter. Required if `start_number` given. | [optional] | +| **end_year** | **int**| Year for `end_number` parameter. Required if `end_number` given. | [optional] | +| **type** | [**DocumentType**](../Model/.md)| Filter documents by type | [optional] | +| **query** | **string**| Filter documents by the given text | [optional] | +| **paid_start_date** | **\DateTime**| Filter documents by their payment date. | [optional] | +| **paid_end_date** | **\DateTime**| Filter documents by their payment date. | [optional] | +| **fulfillment_start_date** | **\DateTime**| Filter documents by their fulfillment date. | [optional] | +| **fulfillment_end_date** | **\DateTime**| Filter documents by their fulfillment date. | [optional] | +| **last_modified_date** | **string**| Filter documents by their last modified date. | [optional] | + +### Return type + +[**\Cone\Billingo\Model\DocumentList**](../Model/DocumentList.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `posPrint()` + +```php +posPrint($id, $size): \SplFileObject +``` + +Returns a printable POS PDF + +Returns a printable POS PDF file of a particular document. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int +$size = 3.4; // float | In which size the POS PDF should be rendered. + +try { + $result = $apiInstance->posPrint($id, $size); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->posPrint: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | +| **size** | **float**| In which size the POS PDF should be rendered. | | + +### Return type + +**\SplFileObject** + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/pdf`, `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `sendDocument()` + +```php +sendDocument($id, $send_document): \Cone\Billingo\Model\SendDocument +``` + +Send invoice to given email adresses. + +Returns a list of emails, where the invoice is sent. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int +$send_document = new \Cone\Billingo\Model\SendDocument(); // \Cone\Billingo\Model\SendDocument | List of email-s where you want to send the invoice. + +try { + $result = $apiInstance->sendDocument($id, $send_document); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->sendDocument: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | +| **send_document** | [**\Cone\Billingo\Model\SendDocument**](../Model/SendDocument.md)| List of email-s where you want to send the invoice. | [optional] | + +### Return type + +[**\Cone\Billingo\Model\SendDocument**](../Model/SendDocument.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updatePayment()` + +```php +updatePayment($id, $payment_history): \Cone\Billingo\Model\PaymentHistory[] +``` + +Update payment history + +Update payment history an existing document. Returns a payment history object if the update is succeded. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int +$payment_history = array(new \Cone\Billingo\Model\PaymentHistory()); // \Cone\Billingo\Model\PaymentHistory[] | Payment history object that you would like to update. + +try { + $result = $apiInstance->updatePayment($id, $payment_history); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentApi->updatePayment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | +| **payment_history** | [**\Cone\Billingo\Model\PaymentHistory[]**](../Model/PaymentHistory.md)| Payment history object that you would like to update. | | + +### Return type + +[**\Cone\Billingo\Model\PaymentHistory[]**](../Model/PaymentHistory.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/DocumentExportApi.md b/docs/Api/DocumentExportApi.md new file mode 100644 index 0000000..1b07518 --- /dev/null +++ b/docs/Api/DocumentExportApi.md @@ -0,0 +1,196 @@ +# Cone\Billingo\DocumentExportApi + +All URIs are relative to https://api.billingo.hu/v3, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**create()**](DocumentExportApi.md#create) | **POST** /document-export | Create document export. | +| [**download()**](DocumentExportApi.md#download) | **GET** /document-export/{id}/download | Return exported binary file. | +| [**poll()**](DocumentExportApi.md#poll) | **GET** /document-export/{id}/poll | Retrieve export state. | + + +## `create()` + +```php +create($create_document_export): \Cone\Billingo\Model\DocumentExportId +``` + +Create document export. + +Return with the id of the export. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentExportApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$create_document_export = new \Cone\Billingo\Model\CreateDocumentExport(); // \Cone\Billingo\Model\CreateDocumentExport | Create document export body. + +try { + $result = $apiInstance->create($create_document_export); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentExportApi->create: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **create_document_export** | [**\Cone\Billingo\Model\CreateDocumentExport**](../Model/CreateDocumentExport.md)| Create document export body. | | + +### Return type + +[**\Cone\Billingo\Model\DocumentExportId**](../Model/DocumentExportId.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `download()` + +```php +download($id): \SplFileObject +``` + +Return exported binary file. + +Return the exported file. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentExportApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The ID from create document export endpoint. + +try { + $result = $apiInstance->download($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentExportApi->download: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The ID from create document export endpoint. | | + +### Return type + +**\SplFileObject** + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/*`, `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `poll()` + +```php +poll($id): \Cone\Billingo\Model\DocumentExportStatus +``` + +Retrieve export state. + +Return state of the given export. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\DocumentExportApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | The ID from create document export endpoint. + +try { + $result = $apiInstance->poll($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentExportApi->poll: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| The ID from create document export endpoint. | | + +### Return type + +[**\Cone\Billingo\Model\DocumentExportStatus**](../Model/DocumentExportStatus.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/InventoryApi.md b/docs/Api/InventoryApi.md new file mode 100644 index 0000000..cc0aaa1 --- /dev/null +++ b/docs/Api/InventoryApi.md @@ -0,0 +1,70 @@ +# Cone\Billingo\InventoryApi + +All URIs are relative to https://api.billingo.hu/v3, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getProductQuantity()**](InventoryApi.md#getProductQuantity) | **GET** /inventory/product/{id}/quantity | Retrieve product quantity | + + +## `getProductQuantity()` + +```php +getProductQuantity($id): \Cone\Billingo\Model\ProductQuantity +``` + +Retrieve product quantity + +Retrieves product quantity from the default warehouse. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\InventoryApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $result = $apiInstance->getProductQuantity($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling InventoryApi->getProductQuantity: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +[**\Cone\Billingo\Model\ProductQuantity**](../Model/ProductQuantity.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/OrganizationApi.md b/docs/Api/OrganizationApi.md new file mode 100644 index 0000000..89fd314 --- /dev/null +++ b/docs/Api/OrganizationApi.md @@ -0,0 +1,67 @@ +# Cone\Billingo\OrganizationApi + +All URIs are relative to https://api.billingo.hu/v3, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getOrganizationData()**](OrganizationApi.md#getOrganizationData) | **GET** /organization | Retrieve a organization data. | + + +## `getOrganizationData()` + +```php +getOrganizationData(): \Cone\Billingo\Model\OrganizationData +``` + +Retrieve a organization data. + +Retrieves the data of organization. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\OrganizationApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->getOrganizationData(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrganizationApi->getOrganizationData: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Cone\Billingo\Model\OrganizationData**](../Model/OrganizationData.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/PartnerApi.md b/docs/Api/PartnerApi.md new file mode 100644 index 0000000..c3cb8dd --- /dev/null +++ b/docs/Api/PartnerApi.md @@ -0,0 +1,137 @@ +# Cone\Billingo\PartnerApi + +All URIs are relative to https://api.billingo.hu/v3, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createPartner()**](PartnerApi.md#createPartner) | **POST** /partners | Create a partner | +| [**listPartner()**](PartnerApi.md#listPartner) | **GET** /partners | List all partners | + + +## `createPartner()` + +```php +createPartner($partner): \Cone\Billingo\Model\Partner +``` + +Create a partner + +Create a new partner. Returns a partner object if the create is succeded. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\PartnerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$partner = new \Cone\Billingo\Model\Partner(); // \Cone\Billingo\Model\Partner | Partner object that you would like to store. + +try { + $result = $apiInstance->createPartner($partner); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PartnerApi->createPartner: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **partner** | [**\Cone\Billingo\Model\Partner**](../Model/Partner.md)| Partner object that you would like to store. | | + +### Return type + +[**\Cone\Billingo\Model\Partner**](../Model/Partner.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listPartner()` + +```php +listPartner($page, $per_page, $query): \Cone\Billingo\Model\PartnerList +``` + +List all partners + +Returns a list of your partners. The partners are returned sorted by creation date, with the most recent partners appearing first. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\PartnerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$page = 56; // int +$per_page = 25; // int +$query = 'query_example'; // string + +try { + $result = $apiInstance->listPartner($page, $per_page, $query); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PartnerApi->listPartner: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **page** | **int**| | [optional] | +| **per_page** | **int**| | [optional] [default to 25] | +| **query** | **string**| | [optional] | + +### Return type + +[**\Cone\Billingo\Model\PartnerList**](../Model/PartnerList.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/ProductApi.md b/docs/Api/ProductApi.md new file mode 100644 index 0000000..a5a4729 --- /dev/null +++ b/docs/Api/ProductApi.md @@ -0,0 +1,327 @@ +# Cone\Billingo\ProductApi + +All URIs are relative to https://api.billingo.hu/v3, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createProduct()**](ProductApi.md#createProduct) | **POST** /products | Create a product | +| [**deleteProduct()**](ProductApi.md#deleteProduct) | **DELETE** /products/{id} | Delete a product | +| [**getProduct()**](ProductApi.md#getProduct) | **GET** /products/{id} | Retrieve a product | +| [**listProduct()**](ProductApi.md#listProduct) | **GET** /products | List all product | +| [**updateProduct()**](ProductApi.md#updateProduct) | **PUT** /products/{id} | Update a product | + + +## `createProduct()` + +```php +createProduct($product): \Cone\Billingo\Model\Product +``` + +Create a product + +Create a new product. Returns a product object if the create is succeded. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\ProductApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$product = new \Cone\Billingo\Model\Product(); // \Cone\Billingo\Model\Product | Product object that you would like to store. + +try { + $result = $apiInstance->createProduct($product); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductApi->createProduct: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **product** | [**\Cone\Billingo\Model\Product**](../Model/Product.md)| Product object that you would like to store. | | + +### Return type + +[**\Cone\Billingo\Model\Product**](../Model/Product.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteProduct()` + +```php +deleteProduct($id) +``` + +Delete a product + +Delete an existing product. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\ProductApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $apiInstance->deleteProduct($id); +} catch (Exception $e) { + echo 'Exception when calling ProductApi->deleteProduct: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getProduct()` + +```php +getProduct($id): \Cone\Billingo\Model\Product +``` + +Retrieve a product + +Retrieves the details of an existing product. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\ProductApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $result = $apiInstance->getProduct($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductApi->getProduct: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +[**\Cone\Billingo\Model\Product**](../Model/Product.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listProduct()` + +```php +listProduct($page, $per_page, $query): \Cone\Billingo\Model\ProductList +``` + +List all product + +Returns a list of your products. The partners are returned sorted by creation date, with the most recent partners appearing first. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\ProductApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$page = 56; // int +$per_page = 25; // int +$query = 'query_example'; // string + +try { + $result = $apiInstance->listProduct($page, $per_page, $query); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductApi->listProduct: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **page** | **int**| | [optional] | +| **per_page** | **int**| | [optional] [default to 25] | +| **query** | **string**| | [optional] | + +### Return type + +[**\Cone\Billingo\Model\ProductList**](../Model/ProductList.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateProduct()` + +```php +updateProduct($id, $product): \Cone\Billingo\Model\Product +``` + +Update a product + +Update an existing product. Returns a product object if the update is succeded. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\ProductApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int +$product = new \Cone\Billingo\Model\Product(); // \Cone\Billingo\Model\Product | Product object that you would like to update. + +try { + $result = $apiInstance->updateProduct($id, $product); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProductApi->updateProduct: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | +| **product** | [**\Cone\Billingo\Model\Product**](../Model/Product.md)| Product object that you would like to update. | | + +### Return type + +[**\Cone\Billingo\Model\Product**](../Model/Product.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/SpendingApi.md b/docs/Api/SpendingApi.md new file mode 100644 index 0000000..4710645 --- /dev/null +++ b/docs/Api/SpendingApi.md @@ -0,0 +1,341 @@ +# Cone\Billingo\SpendingApi + +All URIs are relative to https://api.billingo.hu/v3, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**spendingDelete()**](SpendingApi.md#spendingDelete) | **DELETE** /spendings/{id} | Deletes a spending. | +| [**spendingList()**](SpendingApi.md#spendingList) | **GET** /spendings | Lists all spending | +| [**spendingSave()**](SpendingApi.md#spendingSave) | **POST** /spendings | Creates a new spending. | +| [**spendingShow()**](SpendingApi.md#spendingShow) | **GET** /spendings/{id} | Retrieves one specific spending. | +| [**spendingUpdate()**](SpendingApi.md#spendingUpdate) | **PUT** /spendings/{id} | Updates a spending item. | + + +## `spendingDelete()` + +```php +spendingDelete($id) +``` + +Deletes a spending. + +Deletes the spending identified by the ID given in path. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\SpendingApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $apiInstance->spendingDelete($id); +} catch (Exception $e) { + echo 'Exception when calling SpendingApi->spendingDelete: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +void (empty response body) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `spendingList()` + +```php +spendingList($q, $page, $per_page, $spending_date, $start_date, $end_date, $payment_status, $spending_type, $categories, $currencies, $payment_methods): \Cone\Billingo\Model\SpendingList +``` + +Lists all spending + +Returns a list of your spending items, ordered by the due date. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\SpendingApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$q = ''; // string +$page = 1; // int +$per_page = 25; // int +$spending_date = invoice_date; // DateType +$start_date = 2021-01-01; // string +$end_date = 2021-01-31; // string +$payment_status = paid; // PaymentStatusSpending +$spending_type = manual; // Source +$categories = overheads; // Category +$currencies = HUF; // Currency +$payment_methods = cash; // PaymentMethod + +try { + $result = $apiInstance->spendingList($q, $page, $per_page, $spending_date, $start_date, $end_date, $payment_status, $spending_type, $categories, $currencies, $payment_methods); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SpendingApi->spendingList: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **q** | **string**| | [optional] [default to ''] | +| **page** | **int**| | [optional] [default to 1] | +| **per_page** | **int**| | [optional] [default to 25] | +| **spending_date** | [**DateType**](../Model/.md)| | [optional] | +| **start_date** | **string**| | [optional] | +| **end_date** | **string**| | [optional] | +| **payment_status** | [**PaymentStatusSpending**](../Model/.md)| | [optional] | +| **spending_type** | [**Source**](../Model/.md)| | [optional] | +| **categories** | [**Category**](../Model/.md)| | [optional] | +| **currencies** | [**Currency**](../Model/.md)| | [optional] | +| **payment_methods** | [**PaymentMethod**](../Model/.md)| | [optional] | + +### Return type + +[**\Cone\Billingo\Model\SpendingList**](../Model/SpendingList.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `spendingSave()` + +```php +spendingSave($spending_save): \Cone\Billingo\Model\Spending +``` + +Creates a new spending. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\SpendingApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$spending_save = new \Cone\Billingo\Model\SpendingSave(); // \Cone\Billingo\Model\SpendingSave + +try { + $result = $apiInstance->spendingSave($spending_save); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SpendingApi->spendingSave: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **spending_save** | [**\Cone\Billingo\Model\SpendingSave**](../Model/SpendingSave.md)| | [optional] | + +### Return type + +[**\Cone\Billingo\Model\Spending**](../Model/Spending.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `spendingShow()` + +```php +spendingShow($id): \Cone\Billingo\Model\Spending +``` + +Retrieves one specific spending. + +Retrives the spending identified by the given ID in path. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\SpendingApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $result = $apiInstance->spendingShow($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SpendingApi->spendingShow: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +[**\Cone\Billingo\Model\Spending**](../Model/Spending.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `spendingUpdate()` + +```php +spendingUpdate($id, $spending_save): \Cone\Billingo\Model\Spending +``` + +Updates a spending item. + +Updates the spending item identified by the ID given in path. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\SpendingApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int +$spending_save = new \Cone\Billingo\Model\SpendingSave(); // \Cone\Billingo\Model\SpendingSave + +try { + $result = $apiInstance->spendingUpdate($id, $spending_save); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SpendingApi->spendingUpdate: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | +| **spending_save** | [**\Cone\Billingo\Model\SpendingSave**](../Model/SpendingSave.md)| | [optional] | + +### Return type + +[**\Cone\Billingo\Model\Spending**](../Model/Spending.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/UtilApi.md b/docs/Api/UtilApi.md new file mode 100644 index 0000000..c1d68dc --- /dev/null +++ b/docs/Api/UtilApi.md @@ -0,0 +1,193 @@ +# Cone\Billingo\UtilApi + +All URIs are relative to https://api.billingo.hu/v3, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**checkTaxNumber()**](UtilApi.md#checkTaxNumber) | **GET** /utils/check-tax-number/{tax_number} | Check tax number. | +| [**getId()**](UtilApi.md#getId) | **GET** /utils/convert-legacy-id/{id} | Convert legacy ID to v3 ID. | +| [**getServerTime()**](UtilApi.md#getServerTime) | **GET** /utils/time | Get the server time | + + +## `checkTaxNumber()` + +```php +checkTaxNumber($tax_number): \Cone\Billingo\Model\TaxNumber +``` + +Check tax number. + +Check the given tax number format, and NAV validate. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\UtilApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$tax_number = 'tax_number_example'; // string + +try { + $result = $apiInstance->checkTaxNumber($tax_number); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UtilApi->checkTaxNumber: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tax_number** | **string**| | | + +### Return type + +[**\Cone\Billingo\Model\TaxNumber**](../Model/TaxNumber.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getId()` + +```php +getId($id): \Cone\Billingo\Model\Id +``` + +Convert legacy ID to v3 ID. + +Retrieves the API v3 ID. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\UtilApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 56; // int + +try { + $result = $apiInstance->getId($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UtilApi->getId: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **int**| | | + +### Return type + +[**\Cone\Billingo\Model\Id**](../Model/Id.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getServerTime()` + +```php +getServerTime(): \Cone\Billingo\Model\ServerTime +``` + +Get the server time + +Return the server time. + +### Example + +```php +setApiKey('X-API-KEY', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Cone\Billingo\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer'); + + +$apiInstance = new Cone\Billingo\Api\UtilApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->getServerTime(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UtilApi->getServerTime: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Cone\Billingo\Model\ServerTime**](../Model/ServerTime.md) + +### Authorization + +[api_key](../../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Model/Address.md b/docs/Model/Address.md new file mode 100644 index 0000000..6e70105 --- /dev/null +++ b/docs/Model/Address.md @@ -0,0 +1,12 @@ +# # Address + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country_code** | [**\Cone\Billingo\Model\Country**](Country.md) | | +**post_code** | **string** | | +**city** | **string** | | +**address** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BankAccount.md b/docs/Model/BankAccount.md new file mode 100644 index 0000000..f640630 --- /dev/null +++ b/docs/Model/BankAccount.md @@ -0,0 +1,15 @@ +# # BankAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**name** | **string** | | +**account_number** | **string** | | +**account_number_iban** | **string** | | [optional] +**swift** | **string** | | [optional] +**currency** | [**\Cone\Billingo\Model\Currency**](Currency.md) | | +**need_qr** | **bool** | | [optional] [default to false] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BankAccountList.md b/docs/Model/BankAccountList.md new file mode 100644 index 0000000..5bdaec8 --- /dev/null +++ b/docs/Model/BankAccountList.md @@ -0,0 +1,15 @@ +# # BankAccountList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Cone\Billingo\Model\BankAccount[]**](BankAccount.md) | | [optional] +**total** | **int** | | [optional] +**per_page** | **int** | | [optional] +**current_page** | **int** | | [optional] +**last_page** | **int** | | [optional] +**prev_page_url** | **string** | | [optional] +**next_page_url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Category.md b/docs/Model/Category.md new file mode 100644 index 0000000..37faa20 --- /dev/null +++ b/docs/Model/Category.md @@ -0,0 +1,8 @@ +# # Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CheckTaxNumberMessage.md b/docs/Model/CheckTaxNumberMessage.md new file mode 100644 index 0000000..babc80e --- /dev/null +++ b/docs/Model/CheckTaxNumberMessage.md @@ -0,0 +1,8 @@ +# # CheckTaxNumberMessage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ClientError.md b/docs/Model/ClientError.md new file mode 100644 index 0000000..5b97bcc --- /dev/null +++ b/docs/Model/ClientError.md @@ -0,0 +1,9 @@ +# # ClientError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ClientErrorResponse.md b/docs/Model/ClientErrorResponse.md new file mode 100644 index 0000000..3efae38 --- /dev/null +++ b/docs/Model/ClientErrorResponse.md @@ -0,0 +1,9 @@ +# # ClientErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Cone\Billingo\Model\ClientError**](ClientError.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ConversationRate.md b/docs/Model/ConversationRate.md new file mode 100644 index 0000000..60fc5e7 --- /dev/null +++ b/docs/Model/ConversationRate.md @@ -0,0 +1,12 @@ +# # ConversationRate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**from_currency** | [**\Cone\Billingo\Model\Currency**](Currency.md) | | [optional] +**to_currency** | [**\Cone\Billingo\Model\Currency**](Currency.md) | | [optional] +**conversation_rate** | **float** | | [optional] +**date** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CorrectionType.md b/docs/Model/CorrectionType.md new file mode 100644 index 0000000..179a906 --- /dev/null +++ b/docs/Model/CorrectionType.md @@ -0,0 +1,8 @@ +# # CorrectionType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Country.md b/docs/Model/Country.md new file mode 100644 index 0000000..11fd8e1 --- /dev/null +++ b/docs/Model/Country.md @@ -0,0 +1,8 @@ +# # Country + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateDocumentExport.md b/docs/Model/CreateDocumentExport.md new file mode 100644 index 0000000..6f856f7 --- /dev/null +++ b/docs/Model/CreateDocumentExport.md @@ -0,0 +1,21 @@ +# # CreateDocumentExport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query_type** | [**\Cone\Billingo\Model\DocumentExportQueryType**](DocumentExportQueryType.md) | | +**start_date** | **\DateTime** | | +**end_date** | **\DateTime** | | +**document_block_id** | **int** | | [optional] +**export_type** | [**\Cone\Billingo\Model\DocumentExportType**](DocumentExportType.md) | | +**number_start_year** | **int** | | [optional] +**number_start_sequence** | **int** | | [optional] +**number_end_year** | **int** | | [optional] +**number_end_sequence** | **int** | | [optional] +**payment_method** | [**\Cone\Billingo\Model\PaymentMethod**](PaymentMethod.md) | | [optional] +**sort_by** | [**\Cone\Billingo\Model\DocumentExportSortBy**](DocumentExportSortBy.md) | | [optional] +**other_options** | [**\Cone\Billingo\Model\DocumentExportOtherOptions**](DocumentExportOtherOptions.md) | | [optional] +**filter_extra** | [**\Cone\Billingo\Model\DocumentExportFilterExtra**](DocumentExportFilterExtra.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Currency.md b/docs/Model/Currency.md new file mode 100644 index 0000000..c294a48 --- /dev/null +++ b/docs/Model/Currency.md @@ -0,0 +1,8 @@ +# # Currency + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DateType.md b/docs/Model/DateType.md new file mode 100644 index 0000000..fffa627 --- /dev/null +++ b/docs/Model/DateType.md @@ -0,0 +1,8 @@ +# # DateType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Discount.md b/docs/Model/Discount.md new file mode 100644 index 0000000..abe2a3e --- /dev/null +++ b/docs/Model/Discount.md @@ -0,0 +1,10 @@ +# # Discount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\Cone\Billingo\Model\DiscountType**](DiscountType.md) | | [optional] +**value** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DiscountType.md b/docs/Model/DiscountType.md new file mode 100644 index 0000000..0760561 --- /dev/null +++ b/docs/Model/DiscountType.md @@ -0,0 +1,8 @@ +# # DiscountType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Document.md b/docs/Model/Document.md new file mode 100644 index 0000000..6d9044b --- /dev/null +++ b/docs/Model/Document.md @@ -0,0 +1,38 @@ +# # Document + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The document's unique identifier. | [optional] +**invoice_number** | **string** | The document's invoice number. | [optional] +**type** | [**\Cone\Billingo\Model\DocumentType**](DocumentType.md) | | [optional] +**cancelled** | **bool** | | [optional] +**block_id** | **int** | DocumentBlock's identifier. | [optional] +**payment_status** | [**\Cone\Billingo\Model\PaymentStatus**](PaymentStatus.md) | | [optional] +**payment_method** | [**\Cone\Billingo\Model\PaymentMethod**](PaymentMethod.md) | | [optional] +**gross_total** | **float** | The document's gross total price. | [optional] +**currency** | [**\Cone\Billingo\Model\Currency**](Currency.md) | | [optional] +**conversion_rate** | **float** | | [optional] +**invoice_date** | **\DateTime** | | [optional] +**fulfillment_date** | **\DateTime** | | [optional] +**due_date** | **\DateTime** | | [optional] +**paid_date** | **\DateTime** | If payment_status equals 'paid' or 'partially_paid', it will show the paid date otherwise the current date. | [optional] +**organization** | [**\Cone\Billingo\Model\DocumentOrganization**](DocumentOrganization.md) | | [optional] +**partner** | [**\Cone\Billingo\Model\Partner**](Partner.md) | | [optional] +**document_partner** | [**\Cone\Billingo\Model\DocumentPartner**](DocumentPartner.md) | | [optional] +**electronic** | **bool** | | [optional] +**comment** | **string** | | [optional] +**tags** | **string[]** | | [optional] +**notification_status** | [**\Cone\Billingo\Model\DocumentNotificationStatus**](DocumentNotificationStatus.md) | | [optional] +**language** | [**\Cone\Billingo\Model\DocumentLanguage**](DocumentLanguage.md) | | [optional] +**items** | [**\Cone\Billingo\Model\DocumentItem[]**](DocumentItem.md) | | [optional] +**summary** | [**\Cone\Billingo\Model\DocumentSummary**](DocumentSummary.md) | | [optional] +**settings** | [**\Cone\Billingo\Model\DocumentSettings**](DocumentSettings.md) | | [optional] +**online_szamla_status** | [**\Cone\Billingo\Model\OnlineSzamlaStatusEnum**](OnlineSzamlaStatusEnum.md) | | [optional] +**related_documents** | [**\Cone\Billingo\Model\DocumentAncestor[]**](DocumentAncestor.md) | | [optional] +**discount** | [**\Cone\Billingo\Model\Discount**](Discount.md) | | [optional] +**correction_type** | [**\Cone\Billingo\Model\CorrectionType**](CorrectionType.md) | | [optional] +**recurring_id** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentAncestor.md b/docs/Model/DocumentAncestor.md new file mode 100644 index 0000000..855b1c0 --- /dev/null +++ b/docs/Model/DocumentAncestor.md @@ -0,0 +1,10 @@ +# # DocumentAncestor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Unique identifier of the related document. | [optional] +**invoice_number** | **string** | Invoice number of the related document. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentBankAccount.md b/docs/Model/DocumentBankAccount.md new file mode 100644 index 0000000..5930976 --- /dev/null +++ b/docs/Model/DocumentBankAccount.md @@ -0,0 +1,13 @@ +# # DocumentBankAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**name** | **string** | | +**account_number** | **string** | | +**account_number_iban** | **string** | | [optional] +**swift** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentBlock.md b/docs/Model/DocumentBlock.md new file mode 100644 index 0000000..731efd0 --- /dev/null +++ b/docs/Model/DocumentBlock.md @@ -0,0 +1,14 @@ +# # DocumentBlock + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **string** | | [optional] +**prefix** | **string** | | [optional] +**custom_field1** | **string** | | [optional] +**custom_field2** | **string** | | [optional] +**type** | [**\Cone\Billingo\Model\DocumentBlockType**](DocumentBlockType.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentBlockList.md b/docs/Model/DocumentBlockList.md new file mode 100644 index 0000000..24e9e21 --- /dev/null +++ b/docs/Model/DocumentBlockList.md @@ -0,0 +1,15 @@ +# # DocumentBlockList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Cone\Billingo\Model\DocumentBlock[]**](DocumentBlock.md) | | [optional] +**total** | **int** | | [optional] +**per_page** | **int** | | [optional] +**current_page** | **int** | | [optional] +**last_page** | **int** | | [optional] +**prev_page_url** | **string** | | [optional] +**next_page_url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentBlockType.md b/docs/Model/DocumentBlockType.md new file mode 100644 index 0000000..cf0031d --- /dev/null +++ b/docs/Model/DocumentBlockType.md @@ -0,0 +1,8 @@ +# # DocumentBlockType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentCancellation.md b/docs/Model/DocumentCancellation.md new file mode 100644 index 0000000..db3f888 --- /dev/null +++ b/docs/Model/DocumentCancellation.md @@ -0,0 +1,10 @@ +# # DocumentCancellation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cancellation_reason** | **string** | | [optional] +**cancellation_recipients** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentExportFilterExtra.md b/docs/Model/DocumentExportFilterExtra.md new file mode 100644 index 0000000..b699fae --- /dev/null +++ b/docs/Model/DocumentExportFilterExtra.md @@ -0,0 +1,17 @@ +# # DocumentExportFilterExtra + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tensoft_vkod** | **string** | | [optional] +**ledger_number** | [**\Cone\Billingo\Model\LedgerNumberInformation**](LedgerNumberInformation.md) | | [optional] +**forintsoft_konyvelesi_naplo_szam** | **string** | | [optional] +**positive_ledger_number** | **string** | | [optional] +**negative_ledger_number** | **string** | | [optional] +**rlb_kata** | **bool** | | [optional] +**rlb_note** | **string** | | [optional] +**novitax_naplokod** | **string** | | [optional] +**use_gross_values** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentExportId.md b/docs/Model/DocumentExportId.md new file mode 100644 index 0000000..0e1d523 --- /dev/null +++ b/docs/Model/DocumentExportId.md @@ -0,0 +1,9 @@ +# # DocumentExportId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentExportOtherOptions.md b/docs/Model/DocumentExportOtherOptions.md new file mode 100644 index 0000000..8d8a55b --- /dev/null +++ b/docs/Model/DocumentExportOtherOptions.md @@ -0,0 +1,8 @@ +# # DocumentExportOtherOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentExportQueryType.md b/docs/Model/DocumentExportQueryType.md new file mode 100644 index 0000000..9095012 --- /dev/null +++ b/docs/Model/DocumentExportQueryType.md @@ -0,0 +1,8 @@ +# # DocumentExportQueryType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentExportSortBy.md b/docs/Model/DocumentExportSortBy.md new file mode 100644 index 0000000..3ed8f00 --- /dev/null +++ b/docs/Model/DocumentExportSortBy.md @@ -0,0 +1,8 @@ +# # DocumentExportSortBy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentExportStatus.md b/docs/Model/DocumentExportStatus.md new file mode 100644 index 0000000..db7c995 --- /dev/null +++ b/docs/Model/DocumentExportStatus.md @@ -0,0 +1,11 @@ +# # DocumentExportStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**state** | [**\Cone\Billingo\Model\DocumentExportStatusState**](DocumentExportStatusState.md) | | [optional] +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentExportStatusState.md b/docs/Model/DocumentExportStatusState.md new file mode 100644 index 0000000..7eb7827 --- /dev/null +++ b/docs/Model/DocumentExportStatusState.md @@ -0,0 +1,8 @@ +# # DocumentExportStatusState + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentExportType.md b/docs/Model/DocumentExportType.md new file mode 100644 index 0000000..88973a3 --- /dev/null +++ b/docs/Model/DocumentExportType.md @@ -0,0 +1,8 @@ +# # DocumentExportType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentForm.md b/docs/Model/DocumentForm.md new file mode 100644 index 0000000..e6e2828 --- /dev/null +++ b/docs/Model/DocumentForm.md @@ -0,0 +1,8 @@ +# # DocumentForm + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentFormat.md b/docs/Model/DocumentFormat.md new file mode 100644 index 0000000..861b367 --- /dev/null +++ b/docs/Model/DocumentFormat.md @@ -0,0 +1,8 @@ +# # DocumentFormat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentInsert.md b/docs/Model/DocumentInsert.md new file mode 100644 index 0000000..85416cf --- /dev/null +++ b/docs/Model/DocumentInsert.md @@ -0,0 +1,28 @@ +# # DocumentInsert + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**vendor_id** | **string** | | [optional] +**partner_id** | **int** | | +**block_id** | **int** | | +**bank_account_id** | **int** | | [optional] +**type** | [**\Cone\Billingo\Model\DocumentInsertType**](DocumentInsertType.md) | | +**fulfillment_date** | **\DateTime** | | +**due_date** | **\DateTime** | | +**payment_method** | [**\Cone\Billingo\Model\PaymentMethod**](PaymentMethod.md) | | +**language** | [**\Cone\Billingo\Model\DocumentLanguage**](DocumentLanguage.md) | | +**currency** | [**\Cone\Billingo\Model\Currency**](Currency.md) | | +**conversion_rate** | **float** | | [optional] +**electronic** | **bool** | | [optional] [default to false] +**paid** | **bool** | | [optional] [default to false] +**items** | [**\Cone\Billingo\Model\DocumentInsertItemsInner[]**](DocumentInsertItemsInner.md) | | [optional] +**comment** | **string** | | [optional] +**settings** | [**\Cone\Billingo\Model\DocumentSettings**](DocumentSettings.md) | | [optional] +**advance_invoice** | **int[]** | | [optional] +**discount** | [**\Cone\Billingo\Model\Discount**](Discount.md) | | [optional] +**instant_payment** | **bool** | | [optional] +**instant_payment_request** | [**\Cone\Billingo\Model\DocumentInsertInstantPaymentRequest**](DocumentInsertInstantPaymentRequest.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentInsertInstantPaymentRequest.md b/docs/Model/DocumentInsertInstantPaymentRequest.md new file mode 100644 index 0000000..6810e48 --- /dev/null +++ b/docs/Model/DocumentInsertInstantPaymentRequest.md @@ -0,0 +1,11 @@ +# # DocumentInsertInstantPaymentRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**debtor_bank_account** | **string** | | [optional] +**different_amount_allowed** | **bool** | | [optional] +**update_partner_payment_details** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentInsertItemsInner.md b/docs/Model/DocumentInsertItemsInner.md new file mode 100644 index 0000000..5c950a5 --- /dev/null +++ b/docs/Model/DocumentInsertItemsInner.md @@ -0,0 +1,18 @@ +# # DocumentInsertItemsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product_id** | **int** | | +**quantity** | **float** | | +**comment** | **string** | | [optional] +**name** | **string** | | +**unit_price** | **float** | | +**unit_price_type** | [**\Cone\Billingo\Model\UnitPriceType**](UnitPriceType.md) | | +**unit** | **string** | | +**vat** | [**\Cone\Billingo\Model\Vat**](Vat.md) | | +**entitlement** | [**\Cone\Billingo\Model\Entitlement**](Entitlement.md) | | [optional] +**sku** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentInsertType.md b/docs/Model/DocumentInsertType.md new file mode 100644 index 0000000..c306835 --- /dev/null +++ b/docs/Model/DocumentInsertType.md @@ -0,0 +1,8 @@ +# # DocumentInsertType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentInstantPaymentRequest.md b/docs/Model/DocumentInstantPaymentRequest.md new file mode 100644 index 0000000..adcb70d --- /dev/null +++ b/docs/Model/DocumentInstantPaymentRequest.md @@ -0,0 +1,11 @@ +# # DocumentInstantPaymentRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**debtor_bank_account** | **string** | | [optional] +**different_amount_allowed** | **bool** | | [optional] +**update_partner_payment_details** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentItem.md b/docs/Model/DocumentItem.md new file mode 100644 index 0000000..c0638a9 --- /dev/null +++ b/docs/Model/DocumentItem.md @@ -0,0 +1,20 @@ +# # DocumentItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product_id** | **int** | | [optional] +**name** | **string** | | [optional] +**net_unit_amount** | **float** | | [optional] +**quantity** | **float** | | [optional] +**unit** | **string** | | [optional] +**net_amount** | **float** | | [optional] +**gross_amount** | **float** | | [optional] +**vat** | [**\Cone\Billingo\Model\Vat**](Vat.md) | | [optional] +**vat_amount** | **float** | | [optional] +**entitlement** | [**\Cone\Billingo\Model\Entitlement**](Entitlement.md) | | [optional] +**comment** | **string** | | [optional] +**sku** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentItemData.md b/docs/Model/DocumentItemData.md new file mode 100644 index 0000000..43b9f5e --- /dev/null +++ b/docs/Model/DocumentItemData.md @@ -0,0 +1,11 @@ +# # DocumentItemData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product_id** | **int** | | +**quantity** | **float** | | +**comment** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentLanguage.md b/docs/Model/DocumentLanguage.md new file mode 100644 index 0000000..82703c8 --- /dev/null +++ b/docs/Model/DocumentLanguage.md @@ -0,0 +1,8 @@ +# # DocumentLanguage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentList.md b/docs/Model/DocumentList.md new file mode 100644 index 0000000..dfa8bd9 --- /dev/null +++ b/docs/Model/DocumentList.md @@ -0,0 +1,15 @@ +# # DocumentList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Cone\Billingo\Model\Document[]**](Document.md) | | [optional] +**total** | **int** | | [optional] +**per_page** | **int** | | [optional] +**current_page** | **int** | | [optional] +**last_page** | **int** | | [optional] +**prev_page_url** | **string** | | [optional] +**next_page_url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentNotificationStatus.md b/docs/Model/DocumentNotificationStatus.md new file mode 100644 index 0000000..d86d130 --- /dev/null +++ b/docs/Model/DocumentNotificationStatus.md @@ -0,0 +1,8 @@ +# # DocumentNotificationStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentOrganization.md b/docs/Model/DocumentOrganization.md new file mode 100644 index 0000000..9477d72 --- /dev/null +++ b/docs/Model/DocumentOrganization.md @@ -0,0 +1,16 @@ +# # DocumentOrganization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**tax_number** | **string** | | [optional] +**bank_account** | [**\Cone\Billingo\Model\DocumentBankAccount**](DocumentBankAccount.md) | | [optional] +**address** | [**\Cone\Billingo\Model\Address**](Address.md) | | [optional] +**small_taxpayer** | **bool** | | [optional] +**ev_number** | **string** | | [optional] +**eu_tax_number** | **string** | | [optional] +**cash_settled** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentPartner.md b/docs/Model/DocumentPartner.md new file mode 100644 index 0000000..b449a6a --- /dev/null +++ b/docs/Model/DocumentPartner.md @@ -0,0 +1,19 @@ +# # DocumentPartner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **string** | | [optional] +**address** | [**\Cone\Billingo\Model\Address**](Address.md) | | [optional] +**emails** | **string[]** | | [optional] +**taxcode** | **string** | | [optional] +**iban** | **string** | | [optional] +**swift** | **string** | | [optional] +**account_number** | **string** | | [optional] +**phone** | **string** | | [optional] +**tax_type** | [**\Cone\Billingo\Model\PartnerTaxType**](PartnerTaxType.md) | | [optional] +**partner_shipping** | [**\Cone\Billingo\Model\DocumentPartnerPartnerShipping**](DocumentPartnerPartnerShipping.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentPartnerPartnerShipping.md b/docs/Model/DocumentPartnerPartnerShipping.md new file mode 100644 index 0000000..499f4e1 --- /dev/null +++ b/docs/Model/DocumentPartnerPartnerShipping.md @@ -0,0 +1,12 @@ +# # DocumentPartnerPartnerShipping + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**match** | **bool** | | [optional] +**name** | **string** | | [optional] +**mode** | [**\Cone\Billingo\Model\ShippingMode**](ShippingMode.md) | | [optional] +**address** | [**\Cone\Billingo\Model\PartnerShippingAddress**](PartnerShippingAddress.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentProductData.md b/docs/Model/DocumentProductData.md new file mode 100644 index 0000000..1b44c4d --- /dev/null +++ b/docs/Model/DocumentProductData.md @@ -0,0 +1,17 @@ +# # DocumentProductData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | +**unit_price** | **float** | | +**unit_price_type** | [**\Cone\Billingo\Model\UnitPriceType**](UnitPriceType.md) | | +**quantity** | **float** | | +**unit** | **string** | | +**vat** | [**\Cone\Billingo\Model\Vat**](Vat.md) | | +**comment** | **string** | | [optional] +**entitlement** | [**\Cone\Billingo\Model\Entitlement**](Entitlement.md) | | [optional] +**sku** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentPublicUrl.md b/docs/Model/DocumentPublicUrl.md new file mode 100644 index 0000000..fe8fbe9 --- /dev/null +++ b/docs/Model/DocumentPublicUrl.md @@ -0,0 +1,9 @@ +# # DocumentPublicUrl + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**public_url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentSettings.md b/docs/Model/DocumentSettings.md new file mode 100644 index 0000000..9d45018 --- /dev/null +++ b/docs/Model/DocumentSettings.md @@ -0,0 +1,20 @@ +# # DocumentSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mediated_service** | **bool** | | [optional] [default to false] +**without_financial_fulfillment** | **bool** | | [optional] [default to false] +**online_payment** | [**\Cone\Billingo\Model\OnlinePayment**](OnlinePayment.md) | | [optional] +**should_send_email** | **bool** | | [optional] [default to false] +**round** | [**\Cone\Billingo\Model\Round**](Round.md) | | [optional] +**no_send_onlineszamla_by_user** | **bool** | | [optional] +**dont_send_to_nav_reason** | [**\Cone\Billingo\Model\DocumentSettingsDontSendToNavReason**](DocumentSettingsDontSendToNavReason.md) | | [optional] +**order_number** | **string** | | [optional] +**place_id** | **int** | | [optional] +**instant_payment** | **bool** | | [optional] +**selected_type** | [**\Cone\Billingo\Model\DocumentType**](DocumentType.md) | | [optional] +**instant_payment_request** | [**\Cone\Billingo\Model\DocumentInsertInstantPaymentRequest**](DocumentInsertInstantPaymentRequest.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentSettingsDontSendToNavReason.md b/docs/Model/DocumentSettingsDontSendToNavReason.md new file mode 100644 index 0000000..db8170c --- /dev/null +++ b/docs/Model/DocumentSettingsDontSendToNavReason.md @@ -0,0 +1,8 @@ +# # DocumentSettingsDontSendToNavReason + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentSummary.md b/docs/Model/DocumentSummary.md new file mode 100644 index 0000000..f078b45 --- /dev/null +++ b/docs/Model/DocumentSummary.md @@ -0,0 +1,14 @@ +# # DocumentSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**net_amount** | **float** | | [optional] +**net_amount_local** | **float** | | [optional] +**gross_amount_local** | **float** | | [optional] +**vat_amount** | **float** | | [optional] +**vat_amount_local** | **float** | | [optional] +**vat_rate_summary** | [**\Cone\Billingo\Model\DocumentVatRateSummary[]**](DocumentVatRateSummary.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentType.md b/docs/Model/DocumentType.md new file mode 100644 index 0000000..4adf4f8 --- /dev/null +++ b/docs/Model/DocumentType.md @@ -0,0 +1,8 @@ +# # DocumentType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DocumentVatRateSummary.md b/docs/Model/DocumentVatRateSummary.md new file mode 100644 index 0000000..28985c0 --- /dev/null +++ b/docs/Model/DocumentVatRateSummary.md @@ -0,0 +1,14 @@ +# # DocumentVatRateSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**vat_name** | **string** | | [optional] +**vat_percentage** | **float** | | [optional] +**vat_rate_net_amount** | **float** | | [optional] +**vat_rate_vat_amount** | **float** | | [optional] +**vat_rate_vat_amount_local** | **float** | | [optional] +**vat_rate_gross_amount** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DontSendToNavReason.md b/docs/Model/DontSendToNavReason.md new file mode 100644 index 0000000..388a0df --- /dev/null +++ b/docs/Model/DontSendToNavReason.md @@ -0,0 +1,8 @@ +# # DontSendToNavReason + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Entitlement.md b/docs/Model/Entitlement.md new file mode 100644 index 0000000..79aff6e --- /dev/null +++ b/docs/Model/Entitlement.md @@ -0,0 +1,8 @@ +# # Entitlement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Feature.md b/docs/Model/Feature.md new file mode 100644 index 0000000..a6e3951 --- /dev/null +++ b/docs/Model/Feature.md @@ -0,0 +1,8 @@ +# # Feature + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Id.md b/docs/Model/Id.md new file mode 100644 index 0000000..66c5a6f --- /dev/null +++ b/docs/Model/Id.md @@ -0,0 +1,10 @@ +# # Id + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**legacy_id** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InvoiceSettings.md b/docs/Model/InvoiceSettings.md new file mode 100644 index 0000000..116eb2d --- /dev/null +++ b/docs/Model/InvoiceSettings.md @@ -0,0 +1,13 @@ +# # InvoiceSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**document_type** | [**\Cone\Billingo\Model\DocumentType**](DocumentType.md) | | [optional] +**fulfillment_date** | **\DateTime** | | [optional] +**due_date** | **\DateTime** | | [optional] +**document_format** | [**\Cone\Billingo\Model\DocumentFormat**](DocumentFormat.md) | | [optional] +**comment** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LedgerNumberInformation.md b/docs/Model/LedgerNumberInformation.md new file mode 100644 index 0000000..3dbc711 --- /dev/null +++ b/docs/Model/LedgerNumberInformation.md @@ -0,0 +1,12 @@ +# # LedgerNumberInformation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bevetel** | **string** | | [optional] +**vevo** | **string** | | [optional] +**penztar** | **string** | | [optional] +**afa** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ModificationDocumentInsert.md b/docs/Model/ModificationDocumentInsert.md new file mode 100644 index 0000000..0c35f0d --- /dev/null +++ b/docs/Model/ModificationDocumentInsert.md @@ -0,0 +1,13 @@ +# # ModificationDocumentInsert + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**due_date** | **\DateTime** | | [optional] +**comment** | **string** | | [optional] +**payment_method** | [**\Cone\Billingo\Model\PaymentMethod**](PaymentMethod.md) | | [optional] +**without_financial_fulfillment** | **bool** | | [optional] [default to false] +**items** | [**\Cone\Billingo\Model\DocumentInsertItemsInner[]**](DocumentInsertItemsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Money.md b/docs/Model/Money.md new file mode 100644 index 0000000..44e7cec --- /dev/null +++ b/docs/Model/Money.md @@ -0,0 +1,10 @@ +# # Money + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **float** | | [optional] +**currency** | [**\Cone\Billingo\Model\Currency**](Currency.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OnlinePayment.md b/docs/Model/OnlinePayment.md new file mode 100644 index 0000000..3b1ab71 --- /dev/null +++ b/docs/Model/OnlinePayment.md @@ -0,0 +1,8 @@ +# # OnlinePayment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OnlineSzamlaStatus.md b/docs/Model/OnlineSzamlaStatus.md new file mode 100644 index 0000000..df60520 --- /dev/null +++ b/docs/Model/OnlineSzamlaStatus.md @@ -0,0 +1,11 @@ +# # OnlineSzamlaStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transaction_id** | **string** | | [optional] +**status** | **string** | | [optional] +**messages** | [**\Cone\Billingo\Model\OnlineSzamlaStatusMessage[]**](OnlineSzamlaStatusMessage.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OnlineSzamlaStatusEnum.md b/docs/Model/OnlineSzamlaStatusEnum.md new file mode 100644 index 0000000..2e966ef --- /dev/null +++ b/docs/Model/OnlineSzamlaStatusEnum.md @@ -0,0 +1,8 @@ +# # OnlineSzamlaStatusEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OnlineSzamlaStatusMessage.md b/docs/Model/OnlineSzamlaStatusMessage.md new file mode 100644 index 0000000..2f3c71a --- /dev/null +++ b/docs/Model/OnlineSzamlaStatusMessage.md @@ -0,0 +1,11 @@ +# # OnlineSzamlaStatusMessage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**validation_result_code** | **string** | | [optional] +**validation_error_code** | **string** | | [optional] +**human_readable_message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrganizationData.md b/docs/Model/OrganizationData.md new file mode 100644 index 0000000..8c2f1c0 --- /dev/null +++ b/docs/Model/OrganizationData.md @@ -0,0 +1,10 @@ +# # OrganizationData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tax_code** | **string** | | [optional] +**subscription** | [**\Cone\Billingo\Model\Subscription**](Subscription.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Partner.md b/docs/Model/Partner.md new file mode 100644 index 0000000..d4d9c21 --- /dev/null +++ b/docs/Model/Partner.md @@ -0,0 +1,25 @@ +# # Partner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**name** | **string** | | [optional] +**address** | [**\Cone\Billingo\Model\Address**](Address.md) | | [optional] +**emails** | **string[]** | | [optional] +**taxcode** | **string** | | [optional] +**iban** | **string** | | [optional] +**swift** | **string** | | [optional] +**account_number** | **string** | | [optional] +**phone** | **string** | | [optional] +**general_ledger_number** | **string** | | [optional] +**tax_type** | [**\Cone\Billingo\Model\PartnerTaxType**](PartnerTaxType.md) | | [optional] +**custom_billing_settings** | [**\Cone\Billingo\Model\PartnerCustomBillingSettings**](PartnerCustomBillingSettings.md) | | [optional] +**group_member_tax_number** | **string** | The tax number of group member. Send tax number for update. Send empty string for delete. Ignored if omitted. | [optional] +**giro_settings** | [**\Cone\Billingo\Model\PartnerGiroSettings**](PartnerGiroSettings.md) | | [optional] +**partner_shipping** | [**\Cone\Billingo\Model\DocumentPartnerPartnerShipping**](DocumentPartnerPartnerShipping.md) | | [optional] +**internal_comment** | **string** | | [optional] +**partner_show_type** | [**\Cone\Billingo\Model\PartnerPartnerShowType**](PartnerPartnerShowType.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PartnerCustomBillingSettings.md b/docs/Model/PartnerCustomBillingSettings.md new file mode 100644 index 0000000..b7393ce --- /dev/null +++ b/docs/Model/PartnerCustomBillingSettings.md @@ -0,0 +1,14 @@ +# # PartnerCustomBillingSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payment_method** | [**\Cone\Billingo\Model\PaymentMethod**](PaymentMethod.md) | | [optional] +**document_form** | [**\Cone\Billingo\Model\DocumentForm**](DocumentForm.md) | | [optional] +**due_days** | **int** | | [optional] +**document_currency** | [**\Cone\Billingo\Model\Currency**](Currency.md) | | [optional] +**template_language_code** | [**\Cone\Billingo\Model\DocumentLanguage**](DocumentLanguage.md) | | [optional] +**discount** | [**\Cone\Billingo\Model\Discount**](Discount.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PartnerGiroSettings.md b/docs/Model/PartnerGiroSettings.md new file mode 100644 index 0000000..9dc0466 --- /dev/null +++ b/docs/Model/PartnerGiroSettings.md @@ -0,0 +1,11 @@ +# # PartnerGiroSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**giro_default_settings** | **bool** | | [optional] +**giro_payment_request_enabled** | **bool** | | [optional] +**giro_different_amount_allowed** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PartnerList.md b/docs/Model/PartnerList.md new file mode 100644 index 0000000..cb874a1 --- /dev/null +++ b/docs/Model/PartnerList.md @@ -0,0 +1,15 @@ +# # PartnerList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Cone\Billingo\Model\Partner[]**](Partner.md) | | [optional] +**total** | **int** | | [optional] +**per_page** | **int** | | [optional] +**current_page** | **int** | | [optional] +**last_page** | **int** | | [optional] +**prev_page_url** | **string** | | [optional] +**next_page_url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PartnerPartnerShowType.md b/docs/Model/PartnerPartnerShowType.md new file mode 100644 index 0000000..c17f000 --- /dev/null +++ b/docs/Model/PartnerPartnerShowType.md @@ -0,0 +1,8 @@ +# # PartnerPartnerShowType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PartnerShipping.md b/docs/Model/PartnerShipping.md new file mode 100644 index 0000000..b4c9115 --- /dev/null +++ b/docs/Model/PartnerShipping.md @@ -0,0 +1,12 @@ +# # PartnerShipping + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**match** | **bool** | | [optional] +**name** | **string** | | [optional] +**mode** | [**\Cone\Billingo\Model\ShippingMode**](ShippingMode.md) | | [optional] +**address** | [**\Cone\Billingo\Model\PartnerShippingAddress**](PartnerShippingAddress.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PartnerShippingAddress.md b/docs/Model/PartnerShippingAddress.md new file mode 100644 index 0000000..8ba4413 --- /dev/null +++ b/docs/Model/PartnerShippingAddress.md @@ -0,0 +1,12 @@ +# # PartnerShippingAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country_code** | [**\Cone\Billingo\Model\Country**](Country.md) | | +**post_code** | **string** | | +**city** | **string** | | +**address** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PartnerShowType.md b/docs/Model/PartnerShowType.md new file mode 100644 index 0000000..3513c08 --- /dev/null +++ b/docs/Model/PartnerShowType.md @@ -0,0 +1,8 @@ +# # PartnerShowType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PartnerTaxType.md b/docs/Model/PartnerTaxType.md new file mode 100644 index 0000000..40f5ca3 --- /dev/null +++ b/docs/Model/PartnerTaxType.md @@ -0,0 +1,8 @@ +# # PartnerTaxType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentHistory.md b/docs/Model/PaymentHistory.md new file mode 100644 index 0000000..b4bdb2c --- /dev/null +++ b/docs/Model/PaymentHistory.md @@ -0,0 +1,13 @@ +# # PaymentHistory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date** | **\DateTime** | | +**price** | **float** | | +**payment_method** | [**\Cone\Billingo\Model\PaymentMethod**](PaymentMethod.md) | | +**voucher_number** | **string** | | [optional] +**conversion_rate** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentMethod.md b/docs/Model/PaymentMethod.md new file mode 100644 index 0000000..2e363b9 --- /dev/null +++ b/docs/Model/PaymentMethod.md @@ -0,0 +1,8 @@ +# # PaymentMethod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentStatus.md b/docs/Model/PaymentStatus.md new file mode 100644 index 0000000..19a4b98 --- /dev/null +++ b/docs/Model/PaymentStatus.md @@ -0,0 +1,8 @@ +# # PaymentStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentStatusSpending.md b/docs/Model/PaymentStatusSpending.md new file mode 100644 index 0000000..7f07d8d --- /dev/null +++ b/docs/Model/PaymentStatusSpending.md @@ -0,0 +1,8 @@ +# # PaymentStatusSpending + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Product.md b/docs/Model/Product.md new file mode 100644 index 0000000..d9efb91 --- /dev/null +++ b/docs/Model/Product.md @@ -0,0 +1,23 @@ +# # Product + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**name** | **string** | | +**comment** | **string** | | [optional] +**currency** | [**\Cone\Billingo\Model\Currency**](Currency.md) | | +**vat** | [**\Cone\Billingo\Model\Vat**](Vat.md) | | +**net_unit_price** | **float** | | [optional] +**gross_unit_price** | **float** | | [optional] +**unit** | **string** | | +**general_ledger_number** | **string** | | [optional] +**general_ledger_taxcode** | **string** | | [optional] +**entitlement** | [**\Cone\Billingo\Model\Entitlement**](Entitlement.md) | | [optional] +**ean** | **string** | | [optional] +**sku** | **string** | | [optional] +**is_manage** | **bool** | | [optional] +**purchase_price** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductList.md b/docs/Model/ProductList.md new file mode 100644 index 0000000..cf07d59 --- /dev/null +++ b/docs/Model/ProductList.md @@ -0,0 +1,15 @@ +# # ProductList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Cone\Billingo\Model\Product[]**](Product.md) | | [optional] +**total** | **int** | | [optional] +**per_page** | **int** | | [optional] +**current_page** | **int** | | [optional] +**last_page** | **int** | | [optional] +**prev_page_url** | **string** | | [optional] +**next_page_url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductQuantity.md b/docs/Model/ProductQuantity.md new file mode 100644 index 0000000..47cdee3 --- /dev/null +++ b/docs/Model/ProductQuantity.md @@ -0,0 +1,9 @@ +# # ProductQuantity + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**available_quantity** | **float** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReceiptInsert.md b/docs/Model/ReceiptInsert.md new file mode 100644 index 0000000..e13b5ec --- /dev/null +++ b/docs/Model/ReceiptInsert.md @@ -0,0 +1,19 @@ +# # ReceiptInsert + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**vendor_id** | **string** | | [optional] +**partner_id** | **int** | | [optional] +**name** | **string** | | [optional] +**emails** | **string[]** | | [optional] +**block_id** | **int** | | +**type** | [**\Cone\Billingo\Model\DocumentType**](DocumentType.md) | | +**payment_method** | [**\Cone\Billingo\Model\PaymentMethod**](PaymentMethod.md) | | +**currency** | [**\Cone\Billingo\Model\Currency**](Currency.md) | | +**conversion_rate** | **float** | | [optional] +**electronic** | **bool** | | [optional] [default to false] +**items** | [**\Cone\Billingo\Model\ReceiptInsertItemsInner[]**](ReceiptInsertItemsInner.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReceiptInsertItemsInner.md b/docs/Model/ReceiptInsertItemsInner.md new file mode 100644 index 0000000..ee211c4 --- /dev/null +++ b/docs/Model/ReceiptInsertItemsInner.md @@ -0,0 +1,12 @@ +# # ReceiptInsertItemsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product_id** | **int** | | +**name** | **string** | | [optional] +**unit_price** | **float** | | +**vat** | [**\Cone\Billingo\Model\Vat**](Vat.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReceiptItemData.md b/docs/Model/ReceiptItemData.md new file mode 100644 index 0000000..b139798 --- /dev/null +++ b/docs/Model/ReceiptItemData.md @@ -0,0 +1,9 @@ +# # ReceiptItemData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product_id** | **int** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReceiptProductData.md b/docs/Model/ReceiptProductData.md new file mode 100644 index 0000000..172ac44 --- /dev/null +++ b/docs/Model/ReceiptProductData.md @@ -0,0 +1,11 @@ +# # ReceiptProductData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**unit_price** | **float** | | +**vat** | [**\Cone\Billingo\Model\Vat**](Vat.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Round.md b/docs/Model/Round.md new file mode 100644 index 0000000..29d270b --- /dev/null +++ b/docs/Model/Round.md @@ -0,0 +1,8 @@ +# # Round + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SendDocument.md b/docs/Model/SendDocument.md new file mode 100644 index 0000000..f4b46c5 --- /dev/null +++ b/docs/Model/SendDocument.md @@ -0,0 +1,9 @@ +# # SendDocument + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**emails** | **string[]** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ServerError.md b/docs/Model/ServerError.md new file mode 100644 index 0000000..5e4a604 --- /dev/null +++ b/docs/Model/ServerError.md @@ -0,0 +1,10 @@ +# # ServerError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **string** | | [optional] +**trace_id** | **string** | You should send us this ID to investigate the issue. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ServerErrorResponse.md b/docs/Model/ServerErrorResponse.md new file mode 100644 index 0000000..722ff0a --- /dev/null +++ b/docs/Model/ServerErrorResponse.md @@ -0,0 +1,9 @@ +# # ServerErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Cone\Billingo\Model\ServerError**](ServerError.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ServerTime.md b/docs/Model/ServerTime.md new file mode 100644 index 0000000..6c729fa --- /dev/null +++ b/docs/Model/ServerTime.md @@ -0,0 +1,12 @@ +# # ServerTime + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**epoch** | **int** | | [optional] +**formatted** | **string** | | [optional] +**w3c** | **string** | | [optional] +**timezone** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ShippingMode.md b/docs/Model/ShippingMode.md new file mode 100644 index 0000000..4e0f1ea --- /dev/null +++ b/docs/Model/ShippingMode.md @@ -0,0 +1,8 @@ +# # ShippingMode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Source.md b/docs/Model/Source.md new file mode 100644 index 0000000..16a36c7 --- /dev/null +++ b/docs/Model/Source.md @@ -0,0 +1,8 @@ +# # Source + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Spending.md b/docs/Model/Spending.md new file mode 100644 index 0000000..7902268 --- /dev/null +++ b/docs/Model/Spending.md @@ -0,0 +1,25 @@ +# # Spending + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**organization_id** | **int** | | [optional] +**category** | [**\Cone\Billingo\Model\Category**](Category.md) | | [optional] +**paid_at** | **\DateTime** | | [optional] +**fulfillment_date** | **\DateTime** | | [optional] +**partner** | [**\Cone\Billingo\Model\SpendingPartner**](SpendingPartner.md) | | [optional] +**invoice_number** | **string** | | [optional] +**currency** | [**\Cone\Billingo\Model\Currency**](Currency.md) | | [optional] +**conversion_rate** | **float** | | [optional] +**total_gross** | **float** | | [optional] +**total_gross_local** | **float** | | [optional] +**total_vat_amount** | **float** | | [optional] +**total_vat_amount_local** | **float** | | [optional] +**invoice_date** | **\DateTime** | | [optional] +**due_date** | **\DateTime** | | [optional] +**payment_method** | [**\Cone\Billingo\Model\SpendingPaymentMethod**](SpendingPaymentMethod.md) | | [optional] +**comment** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpendingList.md b/docs/Model/SpendingList.md new file mode 100644 index 0000000..ee12344 --- /dev/null +++ b/docs/Model/SpendingList.md @@ -0,0 +1,15 @@ +# # SpendingList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Cone\Billingo\Model\SpendingListItem[]**](SpendingListItem.md) | | [optional] +**total** | **int** | | [optional] +**per_page** | **int** | | [optional] +**current_page** | **int** | | [optional] +**last_page** | **int** | | [optional] +**prev_page_url** | **string** | | [optional] +**next_page_url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpendingListItem.md b/docs/Model/SpendingListItem.md new file mode 100644 index 0000000..5ba1172 --- /dev/null +++ b/docs/Model/SpendingListItem.md @@ -0,0 +1,26 @@ +# # SpendingListItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**organization_id** | **int** | | [optional] +**category** | [**\Cone\Billingo\Model\Category**](Category.md) | | [optional] +**paid_at** | **\DateTime** | | [optional] +**fulfillment_date** | **\DateTime** | | [optional] +**partner** | [**\Cone\Billingo\Model\SpendingPartner**](SpendingPartner.md) | | [optional] +**invoice_number** | **string** | | [optional] +**currency** | [**\Cone\Billingo\Model\Currency**](Currency.md) | | [optional] +**conversion_rate** | **float** | | [optional] +**total_gross** | **float** | | [optional] +**total_gross_local** | **float** | | [optional] +**total_vat_amount** | **float** | | [optional] +**total_vat_amount_local** | **float** | | [optional] +**invoice_date** | **\DateTime** | | [optional] +**due_date** | **\DateTime** | | [optional] +**payment_method** | [**\Cone\Billingo\Model\SpendingPaymentMethod**](SpendingPaymentMethod.md) | | [optional] +**comment** | **string** | | [optional] +**is_created_by_nav** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpendingPartner.md b/docs/Model/SpendingPartner.md new file mode 100644 index 0000000..f4d9eb6 --- /dev/null +++ b/docs/Model/SpendingPartner.md @@ -0,0 +1,18 @@ +# # SpendingPartner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **string** | | [optional] +**tax_code** | **string** | | [optional] +**address** | [**\Cone\Billingo\Model\Address**](Address.md) | | [optional] +**iban** | **string** | | [optional] +**swift** | **string** | | [optional] +**account_number** | **string** | | [optional] +**phone** | **string** | | [optional] +**internal_comment** | **string** | | [optional] +**group_member_tax_number** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpendingPaymentMethod.md b/docs/Model/SpendingPaymentMethod.md new file mode 100644 index 0000000..92552c0 --- /dev/null +++ b/docs/Model/SpendingPaymentMethod.md @@ -0,0 +1,8 @@ +# # SpendingPaymentMethod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SpendingSave.md b/docs/Model/SpendingSave.md new file mode 100644 index 0000000..03788eb --- /dev/null +++ b/docs/Model/SpendingSave.md @@ -0,0 +1,23 @@ +# # SpendingSave + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | [**\Cone\Billingo\Model\Currency**](Currency.md) | | +**conversion_rate** | **float** | | [optional] +**total_gross** | **float** | | +**total_gross_huf** | **float** | | +**total_vat_amount** | **float** | | +**total_vat_amount_huf** | **float** | | +**fulfillment_date** | **\DateTime** | | +**paid_at** | **\DateTime** | | [optional] +**category** | [**\Cone\Billingo\Model\Category**](Category.md) | | +**comment** | **string** | | [optional] +**invoice_number** | **string** | | [optional] +**invoice_date** | **\DateTime** | | [optional] +**due_date** | **\DateTime** | | [optional] +**payment_method** | [**\Cone\Billingo\Model\SpendingPaymentMethod**](SpendingPaymentMethod.md) | | +**partner_id** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Subscription.md b/docs/Model/Subscription.md new file mode 100644 index 0000000..8781fd1 --- /dev/null +++ b/docs/Model/Subscription.md @@ -0,0 +1,10 @@ +# # Subscription + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expiration_date** | **\DateTime** | | [optional] +**features** | [**\Cone\Billingo\Model\Feature[]**](Feature.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionErrorResponse.md b/docs/Model/SubscriptionErrorResponse.md new file mode 100644 index 0000000..4d9852f --- /dev/null +++ b/docs/Model/SubscriptionErrorResponse.md @@ -0,0 +1,9 @@ +# # SubscriptionErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Cone\Billingo\Model\ClientError**](ClientError.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TaxNumber.md b/docs/Model/TaxNumber.md new file mode 100644 index 0000000..dae3f7b --- /dev/null +++ b/docs/Model/TaxNumber.md @@ -0,0 +1,10 @@ +# # TaxNumber + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tax_number** | **string** | | [optional] +**result** | [**\Cone\Billingo\Model\CheckTaxNumberMessage**](CheckTaxNumberMessage.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TooManyRequestsResponse.md b/docs/Model/TooManyRequestsResponse.md new file mode 100644 index 0000000..f9228a6 --- /dev/null +++ b/docs/Model/TooManyRequestsResponse.md @@ -0,0 +1,9 @@ +# # TooManyRequestsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Cone\Billingo\Model\ClientError**](ClientError.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UnitPriceType.md b/docs/Model/UnitPriceType.md new file mode 100644 index 0000000..cb02d06 --- /dev/null +++ b/docs/Model/UnitPriceType.md @@ -0,0 +1,8 @@ +# # UnitPriceType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ValidationError.md b/docs/Model/ValidationError.md new file mode 100644 index 0000000..61dabdf --- /dev/null +++ b/docs/Model/ValidationError.md @@ -0,0 +1,10 @@ +# # ValidationError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **string** | | [optional] +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ValidationErrorResponse.md b/docs/Model/ValidationErrorResponse.md new file mode 100644 index 0000000..2bd1874 --- /dev/null +++ b/docs/Model/ValidationErrorResponse.md @@ -0,0 +1,10 @@ +# # ValidationErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **string** | | [optional] +**errors** | [**\Cone\Billingo\Model\ValidationError[]**](ValidationError.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Vat.md b/docs/Model/Vat.md new file mode 100644 index 0000000..c61a38b --- /dev/null +++ b/docs/Model/Vat.md @@ -0,0 +1,8 @@ +# # Vat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/Api/BankAccountApi.php b/lib/Api/BankAccountApi.php new file mode 100644 index 0000000..0a48382 --- /dev/null +++ b/lib/Api/BankAccountApi.php @@ -0,0 +1,2276 @@ + [ + 'application/json', + ], + 'deleteBankAccount' => [ + 'application/json', + ], + 'getBankAccount' => [ + 'application/json', + ], + 'listBankAccount' => [ + 'application/json', + ], + 'updateBankAccount' => [ + 'application/json', + ], + ]; + +/** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createBankAccount + * + * Create a bank account + * + * @param \Cone\Billingo\Model\BankAccount $bank_account BankAccount object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBankAccount'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\BankAccount|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function createBankAccount($bank_account, string $contentType = self::contentTypes['createBankAccount'][0]) + { + list($response) = $this->createBankAccountWithHttpInfo($bank_account, $contentType); + return $response; + } + + /** + * Operation createBankAccountWithHttpInfo + * + * Create a bank account + * + * @param \Cone\Billingo\Model\BankAccount $bank_account BankAccount object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBankAccount'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\BankAccount|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createBankAccountWithHttpInfo($bank_account, string $contentType = self::contentTypes['createBankAccount'][0]) + { + $request = $this->createBankAccountRequest($bank_account, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 201: + if ('\Cone\Billingo\Model\BankAccount' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\BankAccount' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\BankAccount', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\BankAccount'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\BankAccount', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createBankAccountAsync + * + * Create a bank account + * + * @param \Cone\Billingo\Model\BankAccount $bank_account BankAccount object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createBankAccountAsync($bank_account, string $contentType = self::contentTypes['createBankAccount'][0]) + { + return $this->createBankAccountAsyncWithHttpInfo($bank_account, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createBankAccountAsyncWithHttpInfo + * + * Create a bank account + * + * @param \Cone\Billingo\Model\BankAccount $bank_account BankAccount object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createBankAccountAsyncWithHttpInfo($bank_account, string $contentType = self::contentTypes['createBankAccount'][0]) + { + $returnType = '\Cone\Billingo\Model\BankAccount'; + $request = $this->createBankAccountRequest($bank_account, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createBankAccount' + * + * @param \Cone\Billingo\Model\BankAccount $bank_account BankAccount object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createBankAccountRequest($bank_account, string $contentType = self::contentTypes['createBankAccount'][0]) + { + + // verify the required parameter 'bank_account' is set + if ($bank_account === null || (is_array($bank_account) && count($bank_account) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $bank_account when calling createBankAccount' + ); + } + + + $resourcePath = '/bank-accounts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($bank_account)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($bank_account)); + } else { + $httpBody = $bank_account; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteBankAccount + * + * Delete a bank account + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBankAccount'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteBankAccount($id, string $contentType = self::contentTypes['deleteBankAccount'][0]) + { + $this->deleteBankAccountWithHttpInfo($id, $contentType); + } + + /** + * Operation deleteBankAccountWithHttpInfo + * + * Delete a bank account + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBankAccount'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteBankAccountWithHttpInfo($id, string $contentType = self::contentTypes['deleteBankAccount'][0]) + { + $request = $this->deleteBankAccountRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteBankAccountAsync + * + * Delete a bank account + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteBankAccountAsync($id, string $contentType = self::contentTypes['deleteBankAccount'][0]) + { + return $this->deleteBankAccountAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteBankAccountAsyncWithHttpInfo + * + * Delete a bank account + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteBankAccountAsyncWithHttpInfo($id, string $contentType = self::contentTypes['deleteBankAccount'][0]) + { + $returnType = ''; + $request = $this->deleteBankAccountRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteBankAccount' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteBankAccountRequest($id, string $contentType = self::contentTypes['deleteBankAccount'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteBankAccount' + ); + } + + + $resourcePath = '/bank-accounts/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getBankAccount + * + * Retrieve a bank account + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBankAccount'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\BankAccount|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function getBankAccount($id, string $contentType = self::contentTypes['getBankAccount'][0]) + { + list($response) = $this->getBankAccountWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getBankAccountWithHttpInfo + * + * Retrieve a bank account + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBankAccount'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\BankAccount|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getBankAccountWithHttpInfo($id, string $contentType = self::contentTypes['getBankAccount'][0]) + { + $request = $this->getBankAccountRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\BankAccount' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\BankAccount' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\BankAccount', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\BankAccount'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\BankAccount', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getBankAccountAsync + * + * Retrieve a bank account + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getBankAccountAsync($id, string $contentType = self::contentTypes['getBankAccount'][0]) + { + return $this->getBankAccountAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getBankAccountAsyncWithHttpInfo + * + * Retrieve a bank account + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getBankAccountAsyncWithHttpInfo($id, string $contentType = self::contentTypes['getBankAccount'][0]) + { + $returnType = '\Cone\Billingo\Model\BankAccount'; + $request = $this->getBankAccountRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getBankAccount' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getBankAccountRequest($id, string $contentType = self::contentTypes['getBankAccount'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getBankAccount' + ); + } + + + $resourcePath = '/bank-accounts/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listBankAccount + * + * List all bank account + * + * @param int $page page (optional) + * @param int $per_page per_page (optional, default to 25) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBankAccount'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\BankAccountList|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function listBankAccount($page = null, $per_page = 25, string $contentType = self::contentTypes['listBankAccount'][0]) + { + list($response) = $this->listBankAccountWithHttpInfo($page, $per_page, $contentType); + return $response; + } + + /** + * Operation listBankAccountWithHttpInfo + * + * List all bank account + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBankAccount'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\BankAccountList|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function listBankAccountWithHttpInfo($page = null, $per_page = 25, string $contentType = self::contentTypes['listBankAccount'][0]) + { + $request = $this->listBankAccountRequest($page, $per_page, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\BankAccountList' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\BankAccountList' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\BankAccountList', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\BankAccountList'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\BankAccountList', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listBankAccountAsync + * + * List all bank account + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listBankAccountAsync($page = null, $per_page = 25, string $contentType = self::contentTypes['listBankAccount'][0]) + { + return $this->listBankAccountAsyncWithHttpInfo($page, $per_page, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listBankAccountAsyncWithHttpInfo + * + * List all bank account + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listBankAccountAsyncWithHttpInfo($page = null, $per_page = 25, string $contentType = self::contentTypes['listBankAccount'][0]) + { + $returnType = '\Cone\Billingo\Model\BankAccountList'; + $request = $this->listBankAccountRequest($page, $per_page, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listBankAccount' + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listBankAccountRequest($page = null, $per_page = 25, string $contentType = self::contentTypes['listBankAccount'][0]) + { + + + if ($per_page !== null && $per_page > 100) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling BankAccountApi.listBankAccount, must be smaller than or equal to 100.'); + } + if ($per_page !== null && $per_page < 1) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling BankAccountApi.listBankAccount, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/bank-accounts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $per_page, + 'per_page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateBankAccount + * + * Update a bank account + * + * @param int $id id (required) + * @param \Cone\Billingo\Model\BankAccount $bank_account Bank account object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBankAccount'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\BankAccount|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function updateBankAccount($id, $bank_account, string $contentType = self::contentTypes['updateBankAccount'][0]) + { + list($response) = $this->updateBankAccountWithHttpInfo($id, $bank_account, $contentType); + return $response; + } + + /** + * Operation updateBankAccountWithHttpInfo + * + * Update a bank account + * + * @param int $id (required) + * @param \Cone\Billingo\Model\BankAccount $bank_account Bank account object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBankAccount'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\BankAccount|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateBankAccountWithHttpInfo($id, $bank_account, string $contentType = self::contentTypes['updateBankAccount'][0]) + { + $request = $this->updateBankAccountRequest($id, $bank_account, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\BankAccount' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\BankAccount' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\BankAccount', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\BankAccount'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\BankAccount', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateBankAccountAsync + * + * Update a bank account + * + * @param int $id (required) + * @param \Cone\Billingo\Model\BankAccount $bank_account Bank account object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateBankAccountAsync($id, $bank_account, string $contentType = self::contentTypes['updateBankAccount'][0]) + { + return $this->updateBankAccountAsyncWithHttpInfo($id, $bank_account, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateBankAccountAsyncWithHttpInfo + * + * Update a bank account + * + * @param int $id (required) + * @param \Cone\Billingo\Model\BankAccount $bank_account Bank account object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateBankAccountAsyncWithHttpInfo($id, $bank_account, string $contentType = self::contentTypes['updateBankAccount'][0]) + { + $returnType = '\Cone\Billingo\Model\BankAccount'; + $request = $this->updateBankAccountRequest($id, $bank_account, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateBankAccount' + * + * @param int $id (required) + * @param \Cone\Billingo\Model\BankAccount $bank_account Bank account object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateBankAccount'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateBankAccountRequest($id, $bank_account, string $contentType = self::contentTypes['updateBankAccount'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateBankAccount' + ); + } + + // verify the required parameter 'bank_account' is set + if ($bank_account === null || (is_array($bank_account) && count($bank_account) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $bank_account when calling updateBankAccount' + ); + } + + + $resourcePath = '/bank-accounts/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($bank_account)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($bank_account)); + } else { + $httpBody = $bank_account; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/CurrencyApi.php b/lib/Api/CurrencyApi.php new file mode 100644 index 0000000..5c54356 --- /dev/null +++ b/lib/Api/CurrencyApi.php @@ -0,0 +1,607 @@ + [ + 'application/json', + ], + ]; + +/** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getConversionRate + * + * Get currencies exchange rate. + * + * @param Currency $from from (required) + * @param Currency $to to (required) + * @param \DateTime $date date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConversionRate'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\ConversationRate|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function getConversionRate($from, $to, $date = null, string $contentType = self::contentTypes['getConversionRate'][0]) + { + list($response) = $this->getConversionRateWithHttpInfo($from, $to, $date, $contentType); + return $response; + } + + /** + * Operation getConversionRateWithHttpInfo + * + * Get currencies exchange rate. + * + * @param Currency $from (required) + * @param Currency $to (required) + * @param \DateTime $date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConversionRate'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\ConversationRate|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getConversionRateWithHttpInfo($from, $to, $date = null, string $contentType = self::contentTypes['getConversionRate'][0]) + { + $request = $this->getConversionRateRequest($from, $to, $date, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\ConversationRate' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ConversationRate' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ConversationRate', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\ConversationRate'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ConversationRate', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getConversionRateAsync + * + * Get currencies exchange rate. + * + * @param Currency $from (required) + * @param Currency $to (required) + * @param \DateTime $date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConversionRate'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getConversionRateAsync($from, $to, $date = null, string $contentType = self::contentTypes['getConversionRate'][0]) + { + return $this->getConversionRateAsyncWithHttpInfo($from, $to, $date, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getConversionRateAsyncWithHttpInfo + * + * Get currencies exchange rate. + * + * @param Currency $from (required) + * @param Currency $to (required) + * @param \DateTime $date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConversionRate'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getConversionRateAsyncWithHttpInfo($from, $to, $date = null, string $contentType = self::contentTypes['getConversionRate'][0]) + { + $returnType = '\Cone\Billingo\Model\ConversationRate'; + $request = $this->getConversionRateRequest($from, $to, $date, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getConversionRate' + * + * @param Currency $from (required) + * @param Currency $to (required) + * @param \DateTime $date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConversionRate'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getConversionRateRequest($from, $to, $date = null, string $contentType = self::contentTypes['getConversionRate'][0]) + { + + // verify the required parameter 'from' is set + if ($from === null || (is_array($from) && count($from) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $from when calling getConversionRate' + ); + } + + // verify the required parameter 'to' is set + if ($to === null || (is_array($to) && count($to) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $to when calling getConversionRate' + ); + } + + + + $resourcePath = '/currencies'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from, + 'from', // param base name + 'Currency', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to, + 'to', // param base name + 'Currency', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $date, + 'date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/DocumentApi.php b/lib/Api/DocumentApi.php new file mode 100644 index 0000000..39e45fa --- /dev/null +++ b/lib/Api/DocumentApi.php @@ -0,0 +1,9889 @@ + [ + 'application/json', + ], + 'cancelDocument' => [ + 'application/json', + ], + 'createDocument' => [ + 'application/json', + ], + 'createDocumentFromDraft' => [ + 'application/json', + ], + 'createDocumentFromProforma' => [ + 'application/json', + ], + 'createModificationDocument' => [ + 'application/json', + ], + 'createReceipt' => [ + 'application/json', + ], + 'createReceiptFromDraft' => [ + 'application/json', + ], + 'deleteDocument' => [ + 'application/json', + ], + 'deletePayment' => [ + 'application/json', + ], + 'documentCopy' => [ + 'application/json', + ], + 'downloadDocument' => [ + 'application/json', + ], + 'getDocument' => [ + 'application/json', + ], + 'getDocumentByVendorId' => [ + 'application/json', + ], + 'getOnlineSzamlaStatus' => [ + 'application/json', + ], + 'getPayment' => [ + 'application/json', + ], + 'getPublicUrl' => [ + 'application/json', + ], + 'listDocument' => [ + 'application/json', + ], + 'posPrint' => [ + 'application/json', + ], + 'sendDocument' => [ + 'application/json', + ], + 'updatePayment' => [ + 'application/json', + ], + ]; + +/** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation archiveDocument + * + * Archive a proforma document. + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function archiveDocument($id, string $contentType = self::contentTypes['archiveDocument'][0]) + { + $this->archiveDocumentWithHttpInfo($id, $contentType); + } + + /** + * Operation archiveDocumentWithHttpInfo + * + * Archive a proforma document. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function archiveDocumentWithHttpInfo($id, string $contentType = self::contentTypes['archiveDocument'][0]) + { + $request = $this->archiveDocumentRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation archiveDocumentAsync + * + * Archive a proforma document. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function archiveDocumentAsync($id, string $contentType = self::contentTypes['archiveDocument'][0]) + { + return $this->archiveDocumentAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation archiveDocumentAsyncWithHttpInfo + * + * Archive a proforma document. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function archiveDocumentAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveDocument'][0]) + { + $returnType = ''; + $request = $this->archiveDocumentRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'archiveDocument' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function archiveDocumentRequest($id, string $contentType = self::contentTypes['archiveDocument'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling archiveDocument' + ); + } + + + $resourcePath = '/documents/{id}/archive'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation cancelDocument + * + * Cancel a document + * + * @param int $id id (required) + * @param \Cone\Billingo\Model\DocumentCancellation $document_cancellation Comment and notifiable email addresses - comma separated for multiple email addresses (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function cancelDocument($id, $document_cancellation = null, string $contentType = self::contentTypes['cancelDocument'][0]) + { + list($response) = $this->cancelDocumentWithHttpInfo($id, $document_cancellation, $contentType); + return $response; + } + + /** + * Operation cancelDocumentWithHttpInfo + * + * Cancel a document + * + * @param int $id (required) + * @param \Cone\Billingo\Model\DocumentCancellation $document_cancellation Comment and notifiable email addresses - comma separated for multiple email addresses (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function cancelDocumentWithHttpInfo($id, $document_cancellation = null, string $contentType = self::contentTypes['cancelDocument'][0]) + { + $request = $this->cancelDocumentRequest($id, $document_cancellation, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\Document' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Document' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Document', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Document'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Document', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation cancelDocumentAsync + * + * Cancel a document + * + * @param int $id (required) + * @param \Cone\Billingo\Model\DocumentCancellation $document_cancellation Comment and notifiable email addresses - comma separated for multiple email addresses (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cancelDocumentAsync($id, $document_cancellation = null, string $contentType = self::contentTypes['cancelDocument'][0]) + { + return $this->cancelDocumentAsyncWithHttpInfo($id, $document_cancellation, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation cancelDocumentAsyncWithHttpInfo + * + * Cancel a document + * + * @param int $id (required) + * @param \Cone\Billingo\Model\DocumentCancellation $document_cancellation Comment and notifiable email addresses - comma separated for multiple email addresses (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function cancelDocumentAsyncWithHttpInfo($id, $document_cancellation = null, string $contentType = self::contentTypes['cancelDocument'][0]) + { + $returnType = '\Cone\Billingo\Model\Document'; + $request = $this->cancelDocumentRequest($id, $document_cancellation, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'cancelDocument' + * + * @param int $id (required) + * @param \Cone\Billingo\Model\DocumentCancellation $document_cancellation Comment and notifiable email addresses - comma separated for multiple email addresses (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function cancelDocumentRequest($id, $document_cancellation = null, string $contentType = self::contentTypes['cancelDocument'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling cancelDocument' + ); + } + + + + $resourcePath = '/documents/{id}/cancel'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($document_cancellation)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($document_cancellation)); + } else { + $httpBody = $document_cancellation; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createDocument + * + * Create a document + * + * @param \Cone\Billingo\Model\DocumentInsert $document_insert DocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function createDocument($document_insert, string $contentType = self::contentTypes['createDocument'][0]) + { + list($response) = $this->createDocumentWithHttpInfo($document_insert, $contentType); + return $response; + } + + /** + * Operation createDocumentWithHttpInfo + * + * Create a document + * + * @param \Cone\Billingo\Model\DocumentInsert $document_insert DocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createDocumentWithHttpInfo($document_insert, string $contentType = self::contentTypes['createDocument'][0]) + { + $request = $this->createDocumentRequest($document_insert, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 201: + if ('\Cone\Billingo\Model\Document' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Document' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Document', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Document'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Document', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createDocumentAsync + * + * Create a document + * + * @param \Cone\Billingo\Model\DocumentInsert $document_insert DocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createDocumentAsync($document_insert, string $contentType = self::contentTypes['createDocument'][0]) + { + return $this->createDocumentAsyncWithHttpInfo($document_insert, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createDocumentAsyncWithHttpInfo + * + * Create a document + * + * @param \Cone\Billingo\Model\DocumentInsert $document_insert DocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createDocumentAsyncWithHttpInfo($document_insert, string $contentType = self::contentTypes['createDocument'][0]) + { + $returnType = '\Cone\Billingo\Model\Document'; + $request = $this->createDocumentRequest($document_insert, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createDocument' + * + * @param \Cone\Billingo\Model\DocumentInsert $document_insert DocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createDocumentRequest($document_insert, string $contentType = self::contentTypes['createDocument'][0]) + { + + // verify the required parameter 'document_insert' is set + if ($document_insert === null || (is_array($document_insert) && count($document_insert) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $document_insert when calling createDocument' + ); + } + + + $resourcePath = '/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($document_insert)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($document_insert)); + } else { + $httpBody = $document_insert; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createDocumentFromDraft + * + * Converts a draft to an invoice. + * + * @param int $id id (required) + * @param \Cone\Billingo\Model\DocumentInsert $document_insert DocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocumentFromDraft'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function createDocumentFromDraft($id, $document_insert, string $contentType = self::contentTypes['createDocumentFromDraft'][0]) + { + list($response) = $this->createDocumentFromDraftWithHttpInfo($id, $document_insert, $contentType); + return $response; + } + + /** + * Operation createDocumentFromDraftWithHttpInfo + * + * Converts a draft to an invoice. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\DocumentInsert $document_insert DocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocumentFromDraft'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createDocumentFromDraftWithHttpInfo($id, $document_insert, string $contentType = self::contentTypes['createDocumentFromDraft'][0]) + { + $request = $this->createDocumentFromDraftRequest($id, $document_insert, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\Document' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Document' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Document', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Document'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Document', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createDocumentFromDraftAsync + * + * Converts a draft to an invoice. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\DocumentInsert $document_insert DocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocumentFromDraft'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createDocumentFromDraftAsync($id, $document_insert, string $contentType = self::contentTypes['createDocumentFromDraft'][0]) + { + return $this->createDocumentFromDraftAsyncWithHttpInfo($id, $document_insert, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createDocumentFromDraftAsyncWithHttpInfo + * + * Converts a draft to an invoice. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\DocumentInsert $document_insert DocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocumentFromDraft'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createDocumentFromDraftAsyncWithHttpInfo($id, $document_insert, string $contentType = self::contentTypes['createDocumentFromDraft'][0]) + { + $returnType = '\Cone\Billingo\Model\Document'; + $request = $this->createDocumentFromDraftRequest($id, $document_insert, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createDocumentFromDraft' + * + * @param int $id (required) + * @param \Cone\Billingo\Model\DocumentInsert $document_insert DocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocumentFromDraft'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createDocumentFromDraftRequest($id, $document_insert, string $contentType = self::contentTypes['createDocumentFromDraft'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling createDocumentFromDraft' + ); + } + + // verify the required parameter 'document_insert' is set + if ($document_insert === null || (is_array($document_insert) && count($document_insert) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $document_insert when calling createDocumentFromDraft' + ); + } + + + $resourcePath = '/documents/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($document_insert)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($document_insert)); + } else { + $httpBody = $document_insert; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createDocumentFromProforma + * + * Create a document from proforma. + * + * @param int $id id (required) + * @param \Cone\Billingo\Model\InvoiceSettings $invoice_settings InvoiceSettings object. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocumentFromProforma'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function createDocumentFromProforma($id, $invoice_settings = null, string $contentType = self::contentTypes['createDocumentFromProforma'][0]) + { + list($response) = $this->createDocumentFromProformaWithHttpInfo($id, $invoice_settings, $contentType); + return $response; + } + + /** + * Operation createDocumentFromProformaWithHttpInfo + * + * Create a document from proforma. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\InvoiceSettings $invoice_settings InvoiceSettings object. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocumentFromProforma'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createDocumentFromProformaWithHttpInfo($id, $invoice_settings = null, string $contentType = self::contentTypes['createDocumentFromProforma'][0]) + { + $request = $this->createDocumentFromProformaRequest($id, $invoice_settings, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 201: + if ('\Cone\Billingo\Model\Document' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Document' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Document', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Document'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Document', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createDocumentFromProformaAsync + * + * Create a document from proforma. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\InvoiceSettings $invoice_settings InvoiceSettings object. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocumentFromProforma'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createDocumentFromProformaAsync($id, $invoice_settings = null, string $contentType = self::contentTypes['createDocumentFromProforma'][0]) + { + return $this->createDocumentFromProformaAsyncWithHttpInfo($id, $invoice_settings, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createDocumentFromProformaAsyncWithHttpInfo + * + * Create a document from proforma. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\InvoiceSettings $invoice_settings InvoiceSettings object. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocumentFromProforma'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createDocumentFromProformaAsyncWithHttpInfo($id, $invoice_settings = null, string $contentType = self::contentTypes['createDocumentFromProforma'][0]) + { + $returnType = '\Cone\Billingo\Model\Document'; + $request = $this->createDocumentFromProformaRequest($id, $invoice_settings, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createDocumentFromProforma' + * + * @param int $id (required) + * @param \Cone\Billingo\Model\InvoiceSettings $invoice_settings InvoiceSettings object. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocumentFromProforma'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createDocumentFromProformaRequest($id, $invoice_settings = null, string $contentType = self::contentTypes['createDocumentFromProforma'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling createDocumentFromProforma' + ); + } + + + + $resourcePath = '/documents/{id}/create-from-proforma'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($invoice_settings)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($invoice_settings)); + } else { + $httpBody = $invoice_settings; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createModificationDocument + * + * Create a modification document. + * + * @param int $id id (required) + * @param \Cone\Billingo\Model\ModificationDocumentInsert $modification_document_insert ModificationDocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createModificationDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function createModificationDocument($id, $modification_document_insert, string $contentType = self::contentTypes['createModificationDocument'][0]) + { + list($response) = $this->createModificationDocumentWithHttpInfo($id, $modification_document_insert, $contentType); + return $response; + } + + /** + * Operation createModificationDocumentWithHttpInfo + * + * Create a modification document. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\ModificationDocumentInsert $modification_document_insert ModificationDocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createModificationDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createModificationDocumentWithHttpInfo($id, $modification_document_insert, string $contentType = self::contentTypes['createModificationDocument'][0]) + { + $request = $this->createModificationDocumentRequest($id, $modification_document_insert, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 201: + if ('\Cone\Billingo\Model\Document' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Document' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Document', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Document'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Document', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createModificationDocumentAsync + * + * Create a modification document. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\ModificationDocumentInsert $modification_document_insert ModificationDocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createModificationDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createModificationDocumentAsync($id, $modification_document_insert, string $contentType = self::contentTypes['createModificationDocument'][0]) + { + return $this->createModificationDocumentAsyncWithHttpInfo($id, $modification_document_insert, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createModificationDocumentAsyncWithHttpInfo + * + * Create a modification document. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\ModificationDocumentInsert $modification_document_insert ModificationDocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createModificationDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createModificationDocumentAsyncWithHttpInfo($id, $modification_document_insert, string $contentType = self::contentTypes['createModificationDocument'][0]) + { + $returnType = '\Cone\Billingo\Model\Document'; + $request = $this->createModificationDocumentRequest($id, $modification_document_insert, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createModificationDocument' + * + * @param int $id (required) + * @param \Cone\Billingo\Model\ModificationDocumentInsert $modification_document_insert ModificationDocumentInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createModificationDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createModificationDocumentRequest($id, $modification_document_insert, string $contentType = self::contentTypes['createModificationDocument'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling createModificationDocument' + ); + } + + // verify the required parameter 'modification_document_insert' is set + if ($modification_document_insert === null || (is_array($modification_document_insert) && count($modification_document_insert) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $modification_document_insert when calling createModificationDocument' + ); + } + + + $resourcePath = '/documents/{id}/create-modification-document'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($modification_document_insert)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($modification_document_insert)); + } else { + $httpBody = $modification_document_insert; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createReceipt + * + * Create a receipt + * + * @param \Cone\Billingo\Model\ReceiptInsert $receipt_insert ReceiptInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReceipt'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function createReceipt($receipt_insert, string $contentType = self::contentTypes['createReceipt'][0]) + { + list($response) = $this->createReceiptWithHttpInfo($receipt_insert, $contentType); + return $response; + } + + /** + * Operation createReceiptWithHttpInfo + * + * Create a receipt + * + * @param \Cone\Billingo\Model\ReceiptInsert $receipt_insert ReceiptInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReceipt'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createReceiptWithHttpInfo($receipt_insert, string $contentType = self::contentTypes['createReceipt'][0]) + { + $request = $this->createReceiptRequest($receipt_insert, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 201: + if ('\Cone\Billingo\Model\Document' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Document' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Document', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Document'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Document', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createReceiptAsync + * + * Create a receipt + * + * @param \Cone\Billingo\Model\ReceiptInsert $receipt_insert ReceiptInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReceipt'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createReceiptAsync($receipt_insert, string $contentType = self::contentTypes['createReceipt'][0]) + { + return $this->createReceiptAsyncWithHttpInfo($receipt_insert, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createReceiptAsyncWithHttpInfo + * + * Create a receipt + * + * @param \Cone\Billingo\Model\ReceiptInsert $receipt_insert ReceiptInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReceipt'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createReceiptAsyncWithHttpInfo($receipt_insert, string $contentType = self::contentTypes['createReceipt'][0]) + { + $returnType = '\Cone\Billingo\Model\Document'; + $request = $this->createReceiptRequest($receipt_insert, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createReceipt' + * + * @param \Cone\Billingo\Model\ReceiptInsert $receipt_insert ReceiptInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReceipt'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createReceiptRequest($receipt_insert, string $contentType = self::contentTypes['createReceipt'][0]) + { + + // verify the required parameter 'receipt_insert' is set + if ($receipt_insert === null || (is_array($receipt_insert) && count($receipt_insert) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $receipt_insert when calling createReceipt' + ); + } + + + $resourcePath = '/documents/receipt'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($receipt_insert)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($receipt_insert)); + } else { + $httpBody = $receipt_insert; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createReceiptFromDraft + * + * Converts a draft to a receipt. + * + * @param int $id id (required) + * @param \Cone\Billingo\Model\ReceiptInsert $receipt_insert ReceiptInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReceiptFromDraft'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function createReceiptFromDraft($id, $receipt_insert, string $contentType = self::contentTypes['createReceiptFromDraft'][0]) + { + list($response) = $this->createReceiptFromDraftWithHttpInfo($id, $receipt_insert, $contentType); + return $response; + } + + /** + * Operation createReceiptFromDraftWithHttpInfo + * + * Converts a draft to a receipt. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\ReceiptInsert $receipt_insert ReceiptInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReceiptFromDraft'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createReceiptFromDraftWithHttpInfo($id, $receipt_insert, string $contentType = self::contentTypes['createReceiptFromDraft'][0]) + { + $request = $this->createReceiptFromDraftRequest($id, $receipt_insert, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\Document' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Document' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Document', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Document'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Document', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createReceiptFromDraftAsync + * + * Converts a draft to a receipt. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\ReceiptInsert $receipt_insert ReceiptInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReceiptFromDraft'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createReceiptFromDraftAsync($id, $receipt_insert, string $contentType = self::contentTypes['createReceiptFromDraft'][0]) + { + return $this->createReceiptFromDraftAsyncWithHttpInfo($id, $receipt_insert, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createReceiptFromDraftAsyncWithHttpInfo + * + * Converts a draft to a receipt. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\ReceiptInsert $receipt_insert ReceiptInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReceiptFromDraft'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createReceiptFromDraftAsyncWithHttpInfo($id, $receipt_insert, string $contentType = self::contentTypes['createReceiptFromDraft'][0]) + { + $returnType = '\Cone\Billingo\Model\Document'; + $request = $this->createReceiptFromDraftRequest($id, $receipt_insert, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createReceiptFromDraft' + * + * @param int $id (required) + * @param \Cone\Billingo\Model\ReceiptInsert $receipt_insert ReceiptInsert object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createReceiptFromDraft'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createReceiptFromDraftRequest($id, $receipt_insert, string $contentType = self::contentTypes['createReceiptFromDraft'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling createReceiptFromDraft' + ); + } + + // verify the required parameter 'receipt_insert' is set + if ($receipt_insert === null || (is_array($receipt_insert) && count($receipt_insert) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $receipt_insert when calling createReceiptFromDraft' + ); + } + + + $resourcePath = '/documents/receipt/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($receipt_insert)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($receipt_insert)); + } else { + $httpBody = $receipt_insert; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDocument + * + * Delete a draft. + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteDocument($id, string $contentType = self::contentTypes['deleteDocument'][0]) + { + $this->deleteDocumentWithHttpInfo($id, $contentType); + } + + /** + * Operation deleteDocumentWithHttpInfo + * + * Delete a draft. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDocumentWithHttpInfo($id, string $contentType = self::contentTypes['deleteDocument'][0]) + { + $request = $this->deleteDocumentRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteDocumentAsync + * + * Delete a draft. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteDocumentAsync($id, string $contentType = self::contentTypes['deleteDocument'][0]) + { + return $this->deleteDocumentAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDocumentAsyncWithHttpInfo + * + * Delete a draft. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteDocumentAsyncWithHttpInfo($id, string $contentType = self::contentTypes['deleteDocument'][0]) + { + $returnType = ''; + $request = $this->deleteDocumentRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDocument' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteDocumentRequest($id, string $contentType = self::contentTypes['deleteDocument'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteDocument' + ); + } + + + $resourcePath = '/documents/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deletePayment + * + * Delete all payment history on document + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayment'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\PaymentHistory[]|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function deletePayment($id, string $contentType = self::contentTypes['deletePayment'][0]) + { + list($response) = $this->deletePaymentWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation deletePaymentWithHttpInfo + * + * Delete all payment history on document + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayment'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\PaymentHistory[]|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function deletePaymentWithHttpInfo($id, string $contentType = self::contentTypes['deletePayment'][0]) + { + $request = $this->deletePaymentRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\PaymentHistory[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\PaymentHistory[]' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\PaymentHistory[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\PaymentHistory[]'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\PaymentHistory[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deletePaymentAsync + * + * Delete all payment history on document + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deletePaymentAsync($id, string $contentType = self::contentTypes['deletePayment'][0]) + { + return $this->deletePaymentAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deletePaymentAsyncWithHttpInfo + * + * Delete all payment history on document + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deletePaymentAsyncWithHttpInfo($id, string $contentType = self::contentTypes['deletePayment'][0]) + { + $returnType = '\Cone\Billingo\Model\PaymentHistory[]'; + $request = $this->deletePaymentRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deletePayment' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deletePayment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deletePaymentRequest($id, string $contentType = self::contentTypes['deletePayment'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deletePayment' + ); + } + + + $resourcePath = '/documents/{id}/payments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation documentCopy + * + * Copy a document + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['documentCopy'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function documentCopy($id, string $contentType = self::contentTypes['documentCopy'][0]) + { + list($response) = $this->documentCopyWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation documentCopyWithHttpInfo + * + * Copy a document + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['documentCopy'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function documentCopyWithHttpInfo($id, string $contentType = self::contentTypes['documentCopy'][0]) + { + $request = $this->documentCopyRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\Document' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Document' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Document', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Document'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Document', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation documentCopyAsync + * + * Copy a document + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['documentCopy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function documentCopyAsync($id, string $contentType = self::contentTypes['documentCopy'][0]) + { + return $this->documentCopyAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation documentCopyAsyncWithHttpInfo + * + * Copy a document + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['documentCopy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function documentCopyAsyncWithHttpInfo($id, string $contentType = self::contentTypes['documentCopy'][0]) + { + $returnType = '\Cone\Billingo\Model\Document'; + $request = $this->documentCopyRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'documentCopy' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['documentCopy'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function documentCopyRequest($id, string $contentType = self::contentTypes['documentCopy'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling documentCopy' + ); + } + + + $resourcePath = '/documents/{id}/copy'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation downloadDocument + * + * Download a document in PDF format. + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SplFileObject|\Cone\Billingo\Model\ClientError|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function downloadDocument($id, string $contentType = self::contentTypes['downloadDocument'][0]) + { + list($response) = $this->downloadDocumentWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation downloadDocumentWithHttpInfo + * + * Download a document in PDF format. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SplFileObject|\Cone\Billingo\Model\ClientError|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function downloadDocumentWithHttpInfo($id, string $contentType = self::contentTypes['downloadDocument'][0]) + { + $request = $this->downloadDocumentRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\SplFileObject' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SplFileObject' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\SplFileObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 202: + if ('\Cone\Billingo\Model\ClientError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\SplFileObject'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation downloadDocumentAsync + * + * Download a document in PDF format. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function downloadDocumentAsync($id, string $contentType = self::contentTypes['downloadDocument'][0]) + { + return $this->downloadDocumentAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation downloadDocumentAsyncWithHttpInfo + * + * Download a document in PDF format. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function downloadDocumentAsyncWithHttpInfo($id, string $contentType = self::contentTypes['downloadDocument'][0]) + { + $returnType = '\SplFileObject'; + $request = $this->downloadDocumentRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'downloadDocument' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function downloadDocumentRequest($id, string $contentType = self::contentTypes['downloadDocument'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling downloadDocument' + ); + } + + + $resourcePath = '/documents/{id}/download'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/pdf', 'application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDocument + * + * Retrieve a document + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function getDocument($id, string $contentType = self::contentTypes['getDocument'][0]) + { + list($response) = $this->getDocumentWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getDocumentWithHttpInfo + * + * Retrieve a document + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDocumentWithHttpInfo($id, string $contentType = self::contentTypes['getDocument'][0]) + { + $request = $this->getDocumentRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\Document' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Document' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Document', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Document'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Document', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDocumentAsync + * + * Retrieve a document + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDocumentAsync($id, string $contentType = self::contentTypes['getDocument'][0]) + { + return $this->getDocumentAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDocumentAsyncWithHttpInfo + * + * Retrieve a document + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDocumentAsyncWithHttpInfo($id, string $contentType = self::contentTypes['getDocument'][0]) + { + $returnType = '\Cone\Billingo\Model\Document'; + $request = $this->getDocumentRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDocument' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDocumentRequest($id, string $contentType = self::contentTypes['getDocument'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getDocument' + ); + } + + + $resourcePath = '/documents/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDocumentByVendorId + * + * Retrieve a document by vendor id + * + * @param string $vendor_id vendor_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentByVendorId'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function getDocumentByVendorId($vendor_id, string $contentType = self::contentTypes['getDocumentByVendorId'][0]) + { + list($response) = $this->getDocumentByVendorIdWithHttpInfo($vendor_id, $contentType); + return $response; + } + + /** + * Operation getDocumentByVendorIdWithHttpInfo + * + * Retrieve a document by vendor id + * + * @param string $vendor_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentByVendorId'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Document|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getDocumentByVendorIdWithHttpInfo($vendor_id, string $contentType = self::contentTypes['getDocumentByVendorId'][0]) + { + $request = $this->getDocumentByVendorIdRequest($vendor_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\Document' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Document' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Document', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Document'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Document', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getDocumentByVendorIdAsync + * + * Retrieve a document by vendor id + * + * @param string $vendor_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentByVendorId'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDocumentByVendorIdAsync($vendor_id, string $contentType = self::contentTypes['getDocumentByVendorId'][0]) + { + return $this->getDocumentByVendorIdAsyncWithHttpInfo($vendor_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getDocumentByVendorIdAsyncWithHttpInfo + * + * Retrieve a document by vendor id + * + * @param string $vendor_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentByVendorId'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getDocumentByVendorIdAsyncWithHttpInfo($vendor_id, string $contentType = self::contentTypes['getDocumentByVendorId'][0]) + { + $returnType = '\Cone\Billingo\Model\Document'; + $request = $this->getDocumentByVendorIdRequest($vendor_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDocumentByVendorId' + * + * @param string $vendor_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDocumentByVendorId'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getDocumentByVendorIdRequest($vendor_id, string $contentType = self::contentTypes['getDocumentByVendorId'][0]) + { + + // verify the required parameter 'vendor_id' is set + if ($vendor_id === null || (is_array($vendor_id) && count($vendor_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $vendor_id when calling getDocumentByVendorId' + ); + } + + + $resourcePath = '/documents/vendor/{vendor_id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($vendor_id !== null) { + $resourcePath = str_replace( + '{' . 'vendor_id' . '}', + ObjectSerializer::toPathValue($vendor_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getOnlineSzamlaStatus + * + * Retrieve a document Online Számla status + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOnlineSzamlaStatus'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\OnlineSzamlaStatus|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function getOnlineSzamlaStatus($id, string $contentType = self::contentTypes['getOnlineSzamlaStatus'][0]) + { + list($response) = $this->getOnlineSzamlaStatusWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getOnlineSzamlaStatusWithHttpInfo + * + * Retrieve a document Online Számla status + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOnlineSzamlaStatus'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\OnlineSzamlaStatus|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOnlineSzamlaStatusWithHttpInfo($id, string $contentType = self::contentTypes['getOnlineSzamlaStatus'][0]) + { + $request = $this->getOnlineSzamlaStatusRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\OnlineSzamlaStatus' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\OnlineSzamlaStatus' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\OnlineSzamlaStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\OnlineSzamlaStatus'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\OnlineSzamlaStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOnlineSzamlaStatusAsync + * + * Retrieve a document Online Számla status + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOnlineSzamlaStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOnlineSzamlaStatusAsync($id, string $contentType = self::contentTypes['getOnlineSzamlaStatus'][0]) + { + return $this->getOnlineSzamlaStatusAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOnlineSzamlaStatusAsyncWithHttpInfo + * + * Retrieve a document Online Számla status + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOnlineSzamlaStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOnlineSzamlaStatusAsyncWithHttpInfo($id, string $contentType = self::contentTypes['getOnlineSzamlaStatus'][0]) + { + $returnType = '\Cone\Billingo\Model\OnlineSzamlaStatus'; + $request = $this->getOnlineSzamlaStatusRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOnlineSzamlaStatus' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOnlineSzamlaStatus'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOnlineSzamlaStatusRequest($id, string $contentType = self::contentTypes['getOnlineSzamlaStatus'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getOnlineSzamlaStatus' + ); + } + + + $resourcePath = '/documents/{id}/online-szamla'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPayment + * + * Retrieve a payment histroy + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayment'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\PaymentHistory[]|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function getPayment($id, string $contentType = self::contentTypes['getPayment'][0]) + { + list($response) = $this->getPaymentWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getPaymentWithHttpInfo + * + * Retrieve a payment histroy + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayment'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\PaymentHistory[]|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPaymentWithHttpInfo($id, string $contentType = self::contentTypes['getPayment'][0]) + { + $request = $this->getPaymentRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\PaymentHistory[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\PaymentHistory[]' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\PaymentHistory[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\PaymentHistory[]'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\PaymentHistory[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPaymentAsync + * + * Retrieve a payment histroy + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPaymentAsync($id, string $contentType = self::contentTypes['getPayment'][0]) + { + return $this->getPaymentAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPaymentAsyncWithHttpInfo + * + * Retrieve a payment histroy + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPaymentAsyncWithHttpInfo($id, string $contentType = self::contentTypes['getPayment'][0]) + { + $returnType = '\Cone\Billingo\Model\PaymentHistory[]'; + $request = $this->getPaymentRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPayment' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPayment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPaymentRequest($id, string $contentType = self::contentTypes['getPayment'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPayment' + ); + } + + + $resourcePath = '/documents/{id}/payments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getPublicUrl + * + * Retrieve a document download public url. + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPublicUrl'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\DocumentPublicUrl|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function getPublicUrl($id, string $contentType = self::contentTypes['getPublicUrl'][0]) + { + list($response) = $this->getPublicUrlWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getPublicUrlWithHttpInfo + * + * Retrieve a document download public url. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPublicUrl'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\DocumentPublicUrl|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getPublicUrlWithHttpInfo($id, string $contentType = self::contentTypes['getPublicUrl'][0]) + { + $request = $this->getPublicUrlRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\DocumentPublicUrl' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\DocumentPublicUrl' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\DocumentPublicUrl', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\DocumentPublicUrl'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\DocumentPublicUrl', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getPublicUrlAsync + * + * Retrieve a document download public url. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPublicUrl'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPublicUrlAsync($id, string $contentType = self::contentTypes['getPublicUrl'][0]) + { + return $this->getPublicUrlAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPublicUrlAsyncWithHttpInfo + * + * Retrieve a document download public url. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPublicUrl'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPublicUrlAsyncWithHttpInfo($id, string $contentType = self::contentTypes['getPublicUrl'][0]) + { + $returnType = '\Cone\Billingo\Model\DocumentPublicUrl'; + $request = $this->getPublicUrlRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getPublicUrl' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPublicUrl'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPublicUrlRequest($id, string $contentType = self::contentTypes['getPublicUrl'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getPublicUrl' + ); + } + + + $resourcePath = '/documents/{id}/public-url'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listDocument + * + * List all documents + * + * @param int $page page (optional) + * @param int $per_page per_page (optional, default to 25) + * @param int $block_id Filter documents by the identifier of your DocumentBlock. (optional) + * @param int $partner_id Filter documents by the identifier of your Partner. (optional) + * @param PaymentMethod $payment_method Filter documents by PaymentMethod value. (optional) + * @param PaymentStatus $payment_status Filter documents by PaymentStatus value. (optional) + * @param \DateTime $start_date Filter documents by their invoice date. (optional) + * @param \DateTime $end_date Filter documents by their invoice date. (optional) + * @param int $start_number Starting number of the document, should not contain year or any other formatting. Required if `start_year` given (optional) + * @param int $end_number Ending number of the document, should not contain year or any other formatting. Required if `end_year` given (optional) + * @param int $start_year Year for `start_number` parameter. Required if `start_number` given. (optional) + * @param int $end_year Year for `end_number` parameter. Required if `end_number` given. (optional) + * @param DocumentType $type Filter documents by type (optional) + * @param string $query Filter documents by the given text (optional) + * @param \DateTime $paid_start_date Filter documents by their payment date. (optional) + * @param \DateTime $paid_end_date Filter documents by their payment date. (optional) + * @param \DateTime $fulfillment_start_date Filter documents by their fulfillment date. (optional) + * @param \DateTime $fulfillment_end_date Filter documents by their fulfillment date. (optional) + * @param string $last_modified_date Filter documents by their last modified date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\DocumentList|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function listDocument($page = null, $per_page = 25, $block_id = null, $partner_id = null, $payment_method = null, $payment_status = null, $start_date = null, $end_date = null, $start_number = null, $end_number = null, $start_year = null, $end_year = null, $type = null, $query = null, $paid_start_date = null, $paid_end_date = null, $fulfillment_start_date = null, $fulfillment_end_date = null, $last_modified_date = null, string $contentType = self::contentTypes['listDocument'][0]) + { + list($response) = $this->listDocumentWithHttpInfo($page, $per_page, $block_id, $partner_id, $payment_method, $payment_status, $start_date, $end_date, $start_number, $end_number, $start_year, $end_year, $type, $query, $paid_start_date, $paid_end_date, $fulfillment_start_date, $fulfillment_end_date, $last_modified_date, $contentType); + return $response; + } + + /** + * Operation listDocumentWithHttpInfo + * + * List all documents + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param int $block_id Filter documents by the identifier of your DocumentBlock. (optional) + * @param int $partner_id Filter documents by the identifier of your Partner. (optional) + * @param PaymentMethod $payment_method Filter documents by PaymentMethod value. (optional) + * @param PaymentStatus $payment_status Filter documents by PaymentStatus value. (optional) + * @param \DateTime $start_date Filter documents by their invoice date. (optional) + * @param \DateTime $end_date Filter documents by their invoice date. (optional) + * @param int $start_number Starting number of the document, should not contain year or any other formatting. Required if `start_year` given (optional) + * @param int $end_number Ending number of the document, should not contain year or any other formatting. Required if `end_year` given (optional) + * @param int $start_year Year for `start_number` parameter. Required if `start_number` given. (optional) + * @param int $end_year Year for `end_number` parameter. Required if `end_number` given. (optional) + * @param DocumentType $type Filter documents by type (optional) + * @param string $query Filter documents by the given text (optional) + * @param \DateTime $paid_start_date Filter documents by their payment date. (optional) + * @param \DateTime $paid_end_date Filter documents by their payment date. (optional) + * @param \DateTime $fulfillment_start_date Filter documents by their fulfillment date. (optional) + * @param \DateTime $fulfillment_end_date Filter documents by their fulfillment date. (optional) + * @param string $last_modified_date Filter documents by their last modified date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\DocumentList|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function listDocumentWithHttpInfo($page = null, $per_page = 25, $block_id = null, $partner_id = null, $payment_method = null, $payment_status = null, $start_date = null, $end_date = null, $start_number = null, $end_number = null, $start_year = null, $end_year = null, $type = null, $query = null, $paid_start_date = null, $paid_end_date = null, $fulfillment_start_date = null, $fulfillment_end_date = null, $last_modified_date = null, string $contentType = self::contentTypes['listDocument'][0]) + { + $request = $this->listDocumentRequest($page, $per_page, $block_id, $partner_id, $payment_method, $payment_status, $start_date, $end_date, $start_number, $end_number, $start_year, $end_year, $type, $query, $paid_start_date, $paid_end_date, $fulfillment_start_date, $fulfillment_end_date, $last_modified_date, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\DocumentList' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\DocumentList' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\DocumentList', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\DocumentList'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\DocumentList', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listDocumentAsync + * + * List all documents + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param int $block_id Filter documents by the identifier of your DocumentBlock. (optional) + * @param int $partner_id Filter documents by the identifier of your Partner. (optional) + * @param PaymentMethod $payment_method Filter documents by PaymentMethod value. (optional) + * @param PaymentStatus $payment_status Filter documents by PaymentStatus value. (optional) + * @param \DateTime $start_date Filter documents by their invoice date. (optional) + * @param \DateTime $end_date Filter documents by their invoice date. (optional) + * @param int $start_number Starting number of the document, should not contain year or any other formatting. Required if `start_year` given (optional) + * @param int $end_number Ending number of the document, should not contain year or any other formatting. Required if `end_year` given (optional) + * @param int $start_year Year for `start_number` parameter. Required if `start_number` given. (optional) + * @param int $end_year Year for `end_number` parameter. Required if `end_number` given. (optional) + * @param DocumentType $type Filter documents by type (optional) + * @param string $query Filter documents by the given text (optional) + * @param \DateTime $paid_start_date Filter documents by their payment date. (optional) + * @param \DateTime $paid_end_date Filter documents by their payment date. (optional) + * @param \DateTime $fulfillment_start_date Filter documents by their fulfillment date. (optional) + * @param \DateTime $fulfillment_end_date Filter documents by their fulfillment date. (optional) + * @param string $last_modified_date Filter documents by their last modified date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listDocumentAsync($page = null, $per_page = 25, $block_id = null, $partner_id = null, $payment_method = null, $payment_status = null, $start_date = null, $end_date = null, $start_number = null, $end_number = null, $start_year = null, $end_year = null, $type = null, $query = null, $paid_start_date = null, $paid_end_date = null, $fulfillment_start_date = null, $fulfillment_end_date = null, $last_modified_date = null, string $contentType = self::contentTypes['listDocument'][0]) + { + return $this->listDocumentAsyncWithHttpInfo($page, $per_page, $block_id, $partner_id, $payment_method, $payment_status, $start_date, $end_date, $start_number, $end_number, $start_year, $end_year, $type, $query, $paid_start_date, $paid_end_date, $fulfillment_start_date, $fulfillment_end_date, $last_modified_date, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listDocumentAsyncWithHttpInfo + * + * List all documents + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param int $block_id Filter documents by the identifier of your DocumentBlock. (optional) + * @param int $partner_id Filter documents by the identifier of your Partner. (optional) + * @param PaymentMethod $payment_method Filter documents by PaymentMethod value. (optional) + * @param PaymentStatus $payment_status Filter documents by PaymentStatus value. (optional) + * @param \DateTime $start_date Filter documents by their invoice date. (optional) + * @param \DateTime $end_date Filter documents by their invoice date. (optional) + * @param int $start_number Starting number of the document, should not contain year or any other formatting. Required if `start_year` given (optional) + * @param int $end_number Ending number of the document, should not contain year or any other formatting. Required if `end_year` given (optional) + * @param int $start_year Year for `start_number` parameter. Required if `start_number` given. (optional) + * @param int $end_year Year for `end_number` parameter. Required if `end_number` given. (optional) + * @param DocumentType $type Filter documents by type (optional) + * @param string $query Filter documents by the given text (optional) + * @param \DateTime $paid_start_date Filter documents by their payment date. (optional) + * @param \DateTime $paid_end_date Filter documents by their payment date. (optional) + * @param \DateTime $fulfillment_start_date Filter documents by their fulfillment date. (optional) + * @param \DateTime $fulfillment_end_date Filter documents by their fulfillment date. (optional) + * @param string $last_modified_date Filter documents by their last modified date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listDocumentAsyncWithHttpInfo($page = null, $per_page = 25, $block_id = null, $partner_id = null, $payment_method = null, $payment_status = null, $start_date = null, $end_date = null, $start_number = null, $end_number = null, $start_year = null, $end_year = null, $type = null, $query = null, $paid_start_date = null, $paid_end_date = null, $fulfillment_start_date = null, $fulfillment_end_date = null, $last_modified_date = null, string $contentType = self::contentTypes['listDocument'][0]) + { + $returnType = '\Cone\Billingo\Model\DocumentList'; + $request = $this->listDocumentRequest($page, $per_page, $block_id, $partner_id, $payment_method, $payment_status, $start_date, $end_date, $start_number, $end_number, $start_year, $end_year, $type, $query, $paid_start_date, $paid_end_date, $fulfillment_start_date, $fulfillment_end_date, $last_modified_date, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listDocument' + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param int $block_id Filter documents by the identifier of your DocumentBlock. (optional) + * @param int $partner_id Filter documents by the identifier of your Partner. (optional) + * @param PaymentMethod $payment_method Filter documents by PaymentMethod value. (optional) + * @param PaymentStatus $payment_status Filter documents by PaymentStatus value. (optional) + * @param \DateTime $start_date Filter documents by their invoice date. (optional) + * @param \DateTime $end_date Filter documents by their invoice date. (optional) + * @param int $start_number Starting number of the document, should not contain year or any other formatting. Required if `start_year` given (optional) + * @param int $end_number Ending number of the document, should not contain year or any other formatting. Required if `end_year` given (optional) + * @param int $start_year Year for `start_number` parameter. Required if `start_number` given. (optional) + * @param int $end_year Year for `end_number` parameter. Required if `end_number` given. (optional) + * @param DocumentType $type Filter documents by type (optional) + * @param string $query Filter documents by the given text (optional) + * @param \DateTime $paid_start_date Filter documents by their payment date. (optional) + * @param \DateTime $paid_end_date Filter documents by their payment date. (optional) + * @param \DateTime $fulfillment_start_date Filter documents by their fulfillment date. (optional) + * @param \DateTime $fulfillment_end_date Filter documents by their fulfillment date. (optional) + * @param string $last_modified_date Filter documents by their last modified date. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listDocumentRequest($page = null, $per_page = 25, $block_id = null, $partner_id = null, $payment_method = null, $payment_status = null, $start_date = null, $end_date = null, $start_number = null, $end_number = null, $start_year = null, $end_year = null, $type = null, $query = null, $paid_start_date = null, $paid_end_date = null, $fulfillment_start_date = null, $fulfillment_end_date = null, $last_modified_date = null, string $contentType = self::contentTypes['listDocument'][0]) + { + + + if ($per_page !== null && $per_page > 100) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling DocumentApi.listDocument, must be smaller than or equal to 100.'); + } + if ($per_page !== null && $per_page < 1) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling DocumentApi.listDocument, must be bigger than or equal to 1.'); + } + + + + + + + + + + + + + + + + + + + + $resourcePath = '/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $per_page, + 'per_page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $block_id, + 'block_id', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $partner_id, + 'partner_id', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payment_method, + 'payment_method', // param base name + 'PaymentMethod', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payment_status, + 'payment_status', // param base name + 'PaymentStatus', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'start_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'end_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_number, + 'start_number', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_number, + 'end_number', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_year, + 'start_year', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_year, + 'end_year', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $type, + 'type', // param base name + 'DocumentType', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $query, + 'query', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $paid_start_date, + 'paid_start_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $paid_end_date, + 'paid_end_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fulfillment_start_date, + 'fulfillment_start_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $fulfillment_end_date, + 'fulfillment_end_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $last_modified_date, + 'last_modified_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation posPrint + * + * Returns a printable POS PDF + * + * @param int $id id (required) + * @param float $size In which size the POS PDF should be rendered. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['posPrint'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SplFileObject|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function posPrint($id, $size, string $contentType = self::contentTypes['posPrint'][0]) + { + list($response) = $this->posPrintWithHttpInfo($id, $size, $contentType); + return $response; + } + + /** + * Operation posPrintWithHttpInfo + * + * Returns a printable POS PDF + * + * @param int $id (required) + * @param float $size In which size the POS PDF should be rendered. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['posPrint'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SplFileObject|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function posPrintWithHttpInfo($id, $size, string $contentType = self::contentTypes['posPrint'][0]) + { + $request = $this->posPrintRequest($id, $size, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\SplFileObject' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SplFileObject' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\SplFileObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\SplFileObject'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation posPrintAsync + * + * Returns a printable POS PDF + * + * @param int $id (required) + * @param float $size In which size the POS PDF should be rendered. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['posPrint'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function posPrintAsync($id, $size, string $contentType = self::contentTypes['posPrint'][0]) + { + return $this->posPrintAsyncWithHttpInfo($id, $size, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation posPrintAsyncWithHttpInfo + * + * Returns a printable POS PDF + * + * @param int $id (required) + * @param float $size In which size the POS PDF should be rendered. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['posPrint'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function posPrintAsyncWithHttpInfo($id, $size, string $contentType = self::contentTypes['posPrint'][0]) + { + $returnType = '\SplFileObject'; + $request = $this->posPrintRequest($id, $size, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'posPrint' + * + * @param int $id (required) + * @param float $size In which size the POS PDF should be rendered. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['posPrint'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function posPrintRequest($id, $size, string $contentType = self::contentTypes['posPrint'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling posPrint' + ); + } + + // verify the required parameter 'size' is set + if ($size === null || (is_array($size) && count($size) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $size when calling posPrint' + ); + } + + + $resourcePath = '/documents/{id}/print/pos'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $size, + 'size', // param base name + 'number', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/pdf', 'application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendDocument + * + * Send invoice to given email adresses. + * + * @param int $id id (required) + * @param \Cone\Billingo\Model\SendDocument $send_document List of email-s where you want to send the invoice. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\SendDocument|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function sendDocument($id, $send_document = null, string $contentType = self::contentTypes['sendDocument'][0]) + { + list($response) = $this->sendDocumentWithHttpInfo($id, $send_document, $contentType); + return $response; + } + + /** + * Operation sendDocumentWithHttpInfo + * + * Send invoice to given email adresses. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\SendDocument $send_document List of email-s where you want to send the invoice. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendDocument'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\SendDocument|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function sendDocumentWithHttpInfo($id, $send_document = null, string $contentType = self::contentTypes['sendDocument'][0]) + { + $request = $this->sendDocumentRequest($id, $send_document, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\SendDocument' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SendDocument' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SendDocument', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\SendDocument'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SendDocument', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendDocumentAsync + * + * Send invoice to given email adresses. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\SendDocument $send_document List of email-s where you want to send the invoice. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendDocumentAsync($id, $send_document = null, string $contentType = self::contentTypes['sendDocument'][0]) + { + return $this->sendDocumentAsyncWithHttpInfo($id, $send_document, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendDocumentAsyncWithHttpInfo + * + * Send invoice to given email adresses. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\SendDocument $send_document List of email-s where you want to send the invoice. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendDocumentAsyncWithHttpInfo($id, $send_document = null, string $contentType = self::contentTypes['sendDocument'][0]) + { + $returnType = '\Cone\Billingo\Model\SendDocument'; + $request = $this->sendDocumentRequest($id, $send_document, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sendDocument' + * + * @param int $id (required) + * @param \Cone\Billingo\Model\SendDocument $send_document List of email-s where you want to send the invoice. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendDocument'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function sendDocumentRequest($id, $send_document = null, string $contentType = self::contentTypes['sendDocument'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling sendDocument' + ); + } + + + + $resourcePath = '/documents/{id}/send'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($send_document)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($send_document)); + } else { + $httpBody = $send_document; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updatePayment + * + * Update payment history + * + * @param int $id id (required) + * @param \Cone\Billingo\Model\PaymentHistory[] $payment_history Payment history object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayment'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\PaymentHistory[]|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function updatePayment($id, $payment_history, string $contentType = self::contentTypes['updatePayment'][0]) + { + list($response) = $this->updatePaymentWithHttpInfo($id, $payment_history, $contentType); + return $response; + } + + /** + * Operation updatePaymentWithHttpInfo + * + * Update payment history + * + * @param int $id (required) + * @param \Cone\Billingo\Model\PaymentHistory[] $payment_history Payment history object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayment'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\PaymentHistory[]|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updatePaymentWithHttpInfo($id, $payment_history, string $contentType = self::contentTypes['updatePayment'][0]) + { + $request = $this->updatePaymentRequest($id, $payment_history, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\PaymentHistory[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\PaymentHistory[]' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\PaymentHistory[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\PaymentHistory[]'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\PaymentHistory[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updatePaymentAsync + * + * Update payment history + * + * @param int $id (required) + * @param \Cone\Billingo\Model\PaymentHistory[] $payment_history Payment history object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updatePaymentAsync($id, $payment_history, string $contentType = self::contentTypes['updatePayment'][0]) + { + return $this->updatePaymentAsyncWithHttpInfo($id, $payment_history, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updatePaymentAsyncWithHttpInfo + * + * Update payment history + * + * @param int $id (required) + * @param \Cone\Billingo\Model\PaymentHistory[] $payment_history Payment history object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updatePaymentAsyncWithHttpInfo($id, $payment_history, string $contentType = self::contentTypes['updatePayment'][0]) + { + $returnType = '\Cone\Billingo\Model\PaymentHistory[]'; + $request = $this->updatePaymentRequest($id, $payment_history, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updatePayment' + * + * @param int $id (required) + * @param \Cone\Billingo\Model\PaymentHistory[] $payment_history Payment history object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePayment'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updatePaymentRequest($id, $payment_history, string $contentType = self::contentTypes['updatePayment'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updatePayment' + ); + } + + // verify the required parameter 'payment_history' is set + if ($payment_history === null || (is_array($payment_history) && count($payment_history) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $payment_history when calling updatePayment' + ); + } + + + $resourcePath = '/documents/{id}/payments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($payment_history)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($payment_history)); + } else { + $httpBody = $payment_history; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/DocumentExportApi.php b/lib/Api/DocumentExportApi.php new file mode 100644 index 0000000..3a7875c --- /dev/null +++ b/lib/Api/DocumentExportApi.php @@ -0,0 +1,1496 @@ + [ + 'application/json', + ], + 'download' => [ + 'application/json', + ], + 'poll' => [ + 'application/json', + ], + ]; + +/** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation create + * + * Create document export. + * + * @param \Cone\Billingo\Model\CreateDocumentExport $create_document_export Create document export body. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\DocumentExportId|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function create($create_document_export, string $contentType = self::contentTypes['create'][0]) + { + list($response) = $this->createWithHttpInfo($create_document_export, $contentType); + return $response; + } + + /** + * Operation createWithHttpInfo + * + * Create document export. + * + * @param \Cone\Billingo\Model\CreateDocumentExport $create_document_export Create document export body. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\DocumentExportId|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createWithHttpInfo($create_document_export, string $contentType = self::contentTypes['create'][0]) + { + $request = $this->createRequest($create_document_export, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 201: + if ('\Cone\Billingo\Model\DocumentExportId' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\DocumentExportId' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\DocumentExportId', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\DocumentExportId'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\DocumentExportId', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createAsync + * + * Create document export. + * + * @param \Cone\Billingo\Model\CreateDocumentExport $create_document_export Create document export body. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createAsync($create_document_export, string $contentType = self::contentTypes['create'][0]) + { + return $this->createAsyncWithHttpInfo($create_document_export, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createAsyncWithHttpInfo + * + * Create document export. + * + * @param \Cone\Billingo\Model\CreateDocumentExport $create_document_export Create document export body. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createAsyncWithHttpInfo($create_document_export, string $contentType = self::contentTypes['create'][0]) + { + $returnType = '\Cone\Billingo\Model\DocumentExportId'; + $request = $this->createRequest($create_document_export, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'create' + * + * @param \Cone\Billingo\Model\CreateDocumentExport $create_document_export Create document export body. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createRequest($create_document_export, string $contentType = self::contentTypes['create'][0]) + { + + // verify the required parameter 'create_document_export' is set + if ($create_document_export === null || (is_array($create_document_export) && count($create_document_export) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $create_document_export when calling create' + ); + } + + + $resourcePath = '/document-export'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($create_document_export)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_document_export)); + } else { + $httpBody = $create_document_export; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation download + * + * Return exported binary file. + * + * @param string $id The ID from create document export endpoint. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['download'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SplFileObject|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function download($id, string $contentType = self::contentTypes['download'][0]) + { + list($response) = $this->downloadWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation downloadWithHttpInfo + * + * Return exported binary file. + * + * @param string $id The ID from create document export endpoint. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['download'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SplFileObject|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function downloadWithHttpInfo($id, string $contentType = self::contentTypes['download'][0]) + { + $request = $this->downloadRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\SplFileObject' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\SplFileObject' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\SplFileObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\SplFileObject'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation downloadAsync + * + * Return exported binary file. + * + * @param string $id The ID from create document export endpoint. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['download'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function downloadAsync($id, string $contentType = self::contentTypes['download'][0]) + { + return $this->downloadAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation downloadAsyncWithHttpInfo + * + * Return exported binary file. + * + * @param string $id The ID from create document export endpoint. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['download'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function downloadAsyncWithHttpInfo($id, string $contentType = self::contentTypes['download'][0]) + { + $returnType = '\SplFileObject'; + $request = $this->downloadRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'download' + * + * @param string $id The ID from create document export endpoint. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['download'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function downloadRequest($id, string $contentType = self::contentTypes['download'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling download' + ); + } + + + $resourcePath = '/document-export/{id}/download'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/*', 'application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation poll + * + * Retrieve export state. + * + * @param string $id The ID from create document export endpoint. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['poll'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\DocumentExportStatus|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function poll($id, string $contentType = self::contentTypes['poll'][0]) + { + list($response) = $this->pollWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation pollWithHttpInfo + * + * Retrieve export state. + * + * @param string $id The ID from create document export endpoint. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['poll'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\DocumentExportStatus|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function pollWithHttpInfo($id, string $contentType = self::contentTypes['poll'][0]) + { + $request = $this->pollRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\DocumentExportStatus' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\DocumentExportStatus' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\DocumentExportStatus', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\DocumentExportStatus'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\DocumentExportStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation pollAsync + * + * Retrieve export state. + * + * @param string $id The ID from create document export endpoint. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['poll'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function pollAsync($id, string $contentType = self::contentTypes['poll'][0]) + { + return $this->pollAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pollAsyncWithHttpInfo + * + * Retrieve export state. + * + * @param string $id The ID from create document export endpoint. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['poll'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function pollAsyncWithHttpInfo($id, string $contentType = self::contentTypes['poll'][0]) + { + $returnType = '\Cone\Billingo\Model\DocumentExportStatus'; + $request = $this->pollRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'poll' + * + * @param string $id The ID from create document export endpoint. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['poll'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function pollRequest($id, string $contentType = self::contentTypes['poll'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling poll' + ); + } + + + $resourcePath = '/document-export/{id}/poll'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/InventoryApi.php b/lib/Api/InventoryApi.php new file mode 100644 index 0000000..3122599 --- /dev/null +++ b/lib/Api/InventoryApi.php @@ -0,0 +1,593 @@ + [ + 'application/json', + ], + ]; + +/** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getProductQuantity + * + * Retrieve product quantity + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProductQuantity'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\ProductQuantity|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function getProductQuantity($id, string $contentType = self::contentTypes['getProductQuantity'][0]) + { + list($response) = $this->getProductQuantityWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getProductQuantityWithHttpInfo + * + * Retrieve product quantity + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProductQuantity'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\ProductQuantity|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getProductQuantityWithHttpInfo($id, string $contentType = self::contentTypes['getProductQuantity'][0]) + { + $request = $this->getProductQuantityRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\ProductQuantity' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ProductQuantity' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ProductQuantity', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\ProductQuantity'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ProductQuantity', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProductQuantityAsync + * + * Retrieve product quantity + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProductQuantity'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProductQuantityAsync($id, string $contentType = self::contentTypes['getProductQuantity'][0]) + { + return $this->getProductQuantityAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProductQuantityAsyncWithHttpInfo + * + * Retrieve product quantity + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProductQuantity'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProductQuantityAsyncWithHttpInfo($id, string $contentType = self::contentTypes['getProductQuantity'][0]) + { + $returnType = '\Cone\Billingo\Model\ProductQuantity'; + $request = $this->getProductQuantityRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProductQuantity' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProductQuantity'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getProductQuantityRequest($id, string $contentType = self::contentTypes['getProductQuantity'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getProductQuantity' + ); + } + + + $resourcePath = '/inventory/product/{id}/quantity'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/OrganizationApi.php b/lib/Api/OrganizationApi.php new file mode 100644 index 0000000..afb46c0 --- /dev/null +++ b/lib/Api/OrganizationApi.php @@ -0,0 +1,550 @@ + [ + 'application/json', + ], + ]; + +/** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getOrganizationData + * + * Retrieve a organization data. + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrganizationData'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\OrganizationData|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function getOrganizationData(string $contentType = self::contentTypes['getOrganizationData'][0]) + { + list($response) = $this->getOrganizationDataWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getOrganizationDataWithHttpInfo + * + * Retrieve a organization data. + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrganizationData'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\OrganizationData|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getOrganizationDataWithHttpInfo(string $contentType = self::contentTypes['getOrganizationData'][0]) + { + $request = $this->getOrganizationDataRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\OrganizationData' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\OrganizationData' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\OrganizationData', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\OrganizationData'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\OrganizationData', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getOrganizationDataAsync + * + * Retrieve a organization data. + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrganizationData'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrganizationDataAsync(string $contentType = self::contentTypes['getOrganizationData'][0]) + { + return $this->getOrganizationDataAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getOrganizationDataAsyncWithHttpInfo + * + * Retrieve a organization data. + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrganizationData'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getOrganizationDataAsyncWithHttpInfo(string $contentType = self::contentTypes['getOrganizationData'][0]) + { + $returnType = '\Cone\Billingo\Model\OrganizationData'; + $request = $this->getOrganizationDataRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getOrganizationData' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getOrganizationData'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getOrganizationDataRequest(string $contentType = self::contentTypes['getOrganizationData'][0]) + { + + + $resourcePath = '/organization'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/PartnerApi.php b/lib/Api/PartnerApi.php new file mode 100644 index 0000000..d6fa547 --- /dev/null +++ b/lib/Api/PartnerApi.php @@ -0,0 +1,1052 @@ + [ + 'application/json', + ], + 'listPartner' => [ + 'application/json', + ], + ]; + +/** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createPartner + * + * Create a partner + * + * @param \Cone\Billingo\Model\Partner $partner Partner object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPartner'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Partner|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function createPartner($partner, string $contentType = self::contentTypes['createPartner'][0]) + { + list($response) = $this->createPartnerWithHttpInfo($partner, $contentType); + return $response; + } + + /** + * Operation createPartnerWithHttpInfo + * + * Create a partner + * + * @param \Cone\Billingo\Model\Partner $partner Partner object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPartner'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Partner|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createPartnerWithHttpInfo($partner, string $contentType = self::contentTypes['createPartner'][0]) + { + $request = $this->createPartnerRequest($partner, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 201: + if ('\Cone\Billingo\Model\Partner' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Partner' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Partner', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Partner'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Partner', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createPartnerAsync + * + * Create a partner + * + * @param \Cone\Billingo\Model\Partner $partner Partner object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPartner'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createPartnerAsync($partner, string $contentType = self::contentTypes['createPartner'][0]) + { + return $this->createPartnerAsyncWithHttpInfo($partner, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createPartnerAsyncWithHttpInfo + * + * Create a partner + * + * @param \Cone\Billingo\Model\Partner $partner Partner object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPartner'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createPartnerAsyncWithHttpInfo($partner, string $contentType = self::contentTypes['createPartner'][0]) + { + $returnType = '\Cone\Billingo\Model\Partner'; + $request = $this->createPartnerRequest($partner, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createPartner' + * + * @param \Cone\Billingo\Model\Partner $partner Partner object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPartner'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createPartnerRequest($partner, string $contentType = self::contentTypes['createPartner'][0]) + { + + // verify the required parameter 'partner' is set + if ($partner === null || (is_array($partner) && count($partner) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $partner when calling createPartner' + ); + } + + + $resourcePath = '/partners'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($partner)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($partner)); + } else { + $httpBody = $partner; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listPartner + * + * List all partners + * + * @param int $page page (optional) + * @param int $per_page per_page (optional, default to 25) + * @param string $query query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPartner'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\PartnerList|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function listPartner($page = null, $per_page = 25, $query = null, string $contentType = self::contentTypes['listPartner'][0]) + { + list($response) = $this->listPartnerWithHttpInfo($page, $per_page, $query, $contentType); + return $response; + } + + /** + * Operation listPartnerWithHttpInfo + * + * List all partners + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param string $query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPartner'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\PartnerList|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function listPartnerWithHttpInfo($page = null, $per_page = 25, $query = null, string $contentType = self::contentTypes['listPartner'][0]) + { + $request = $this->listPartnerRequest($page, $per_page, $query, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\PartnerList' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\PartnerList' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\PartnerList', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\PartnerList'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\PartnerList', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listPartnerAsync + * + * List all partners + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param string $query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPartner'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listPartnerAsync($page = null, $per_page = 25, $query = null, string $contentType = self::contentTypes['listPartner'][0]) + { + return $this->listPartnerAsyncWithHttpInfo($page, $per_page, $query, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listPartnerAsyncWithHttpInfo + * + * List all partners + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param string $query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPartner'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listPartnerAsyncWithHttpInfo($page = null, $per_page = 25, $query = null, string $contentType = self::contentTypes['listPartner'][0]) + { + $returnType = '\Cone\Billingo\Model\PartnerList'; + $request = $this->listPartnerRequest($page, $per_page, $query, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listPartner' + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param string $query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPartner'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listPartnerRequest($page = null, $per_page = 25, $query = null, string $contentType = self::contentTypes['listPartner'][0]) + { + + + if ($per_page !== null && $per_page > 100) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling PartnerApi.listPartner, must be smaller than or equal to 100.'); + } + if ($per_page !== null && $per_page < 1) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling PartnerApi.listPartner, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/partners'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $per_page, + 'per_page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $query, + 'query', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ProductApi.php b/lib/Api/ProductApi.php new file mode 100644 index 0000000..1eea5e0 --- /dev/null +++ b/lib/Api/ProductApi.php @@ -0,0 +1,2291 @@ + [ + 'application/json', + ], + 'deleteProduct' => [ + 'application/json', + ], + 'getProduct' => [ + 'application/json', + ], + 'listProduct' => [ + 'application/json', + ], + 'updateProduct' => [ + 'application/json', + ], + ]; + +/** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createProduct + * + * Create a product + * + * @param \Cone\Billingo\Model\Product $product Product object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProduct'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Product|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function createProduct($product, string $contentType = self::contentTypes['createProduct'][0]) + { + list($response) = $this->createProductWithHttpInfo($product, $contentType); + return $response; + } + + /** + * Operation createProductWithHttpInfo + * + * Create a product + * + * @param \Cone\Billingo\Model\Product $product Product object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProduct'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Product|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function createProductWithHttpInfo($product, string $contentType = self::contentTypes['createProduct'][0]) + { + $request = $this->createProductRequest($product, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 201: + if ('\Cone\Billingo\Model\Product' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Product' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Product', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Product'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Product', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createProductAsync + * + * Create a product + * + * @param \Cone\Billingo\Model\Product $product Product object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createProductAsync($product, string $contentType = self::contentTypes['createProduct'][0]) + { + return $this->createProductAsyncWithHttpInfo($product, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createProductAsyncWithHttpInfo + * + * Create a product + * + * @param \Cone\Billingo\Model\Product $product Product object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createProductAsyncWithHttpInfo($product, string $contentType = self::contentTypes['createProduct'][0]) + { + $returnType = '\Cone\Billingo\Model\Product'; + $request = $this->createProductRequest($product, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createProduct' + * + * @param \Cone\Billingo\Model\Product $product Product object that you would like to store. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createProductRequest($product, string $contentType = self::contentTypes['createProduct'][0]) + { + + // verify the required parameter 'product' is set + if ($product === null || (is_array($product) && count($product) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $product when calling createProduct' + ); + } + + + $resourcePath = '/products'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($product)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($product)); + } else { + $httpBody = $product; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteProduct + * + * Delete a product + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteProduct'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteProduct($id, string $contentType = self::contentTypes['deleteProduct'][0]) + { + $this->deleteProductWithHttpInfo($id, $contentType); + } + + /** + * Operation deleteProductWithHttpInfo + * + * Delete a product + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteProduct'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteProductWithHttpInfo($id, string $contentType = self::contentTypes['deleteProduct'][0]) + { + $request = $this->deleteProductRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteProductAsync + * + * Delete a product + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteProductAsync($id, string $contentType = self::contentTypes['deleteProduct'][0]) + { + return $this->deleteProductAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteProductAsyncWithHttpInfo + * + * Delete a product + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteProductAsyncWithHttpInfo($id, string $contentType = self::contentTypes['deleteProduct'][0]) + { + $returnType = ''; + $request = $this->deleteProductRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteProduct' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function deleteProductRequest($id, string $contentType = self::contentTypes['deleteProduct'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteProduct' + ); + } + + + $resourcePath = '/products/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getProduct + * + * Retrieve a product + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProduct'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Product|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function getProduct($id, string $contentType = self::contentTypes['getProduct'][0]) + { + list($response) = $this->getProductWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getProductWithHttpInfo + * + * Retrieve a product + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProduct'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Product|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getProductWithHttpInfo($id, string $contentType = self::contentTypes['getProduct'][0]) + { + $request = $this->getProductRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\Product' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Product' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Product', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Product'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Product', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getProductAsync + * + * Retrieve a product + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProductAsync($id, string $contentType = self::contentTypes['getProduct'][0]) + { + return $this->getProductAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getProductAsyncWithHttpInfo + * + * Retrieve a product + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getProductAsyncWithHttpInfo($id, string $contentType = self::contentTypes['getProduct'][0]) + { + $returnType = '\Cone\Billingo\Model\Product'; + $request = $this->getProductRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getProduct' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getProductRequest($id, string $contentType = self::contentTypes['getProduct'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getProduct' + ); + } + + + $resourcePath = '/products/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listProduct + * + * List all product + * + * @param int $page page (optional) + * @param int $per_page per_page (optional, default to 25) + * @param string $query query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listProduct'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\ProductList|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function listProduct($page = null, $per_page = 25, $query = null, string $contentType = self::contentTypes['listProduct'][0]) + { + list($response) = $this->listProductWithHttpInfo($page, $per_page, $query, $contentType); + return $response; + } + + /** + * Operation listProductWithHttpInfo + * + * List all product + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param string $query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listProduct'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\ProductList|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function listProductWithHttpInfo($page = null, $per_page = 25, $query = null, string $contentType = self::contentTypes['listProduct'][0]) + { + $request = $this->listProductRequest($page, $per_page, $query, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\ProductList' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ProductList' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ProductList', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\ProductList'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ProductList', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listProductAsync + * + * List all product + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param string $query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listProductAsync($page = null, $per_page = 25, $query = null, string $contentType = self::contentTypes['listProduct'][0]) + { + return $this->listProductAsyncWithHttpInfo($page, $per_page, $query, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listProductAsyncWithHttpInfo + * + * List all product + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param string $query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listProductAsyncWithHttpInfo($page = null, $per_page = 25, $query = null, string $contentType = self::contentTypes['listProduct'][0]) + { + $returnType = '\Cone\Billingo\Model\ProductList'; + $request = $this->listProductRequest($page, $per_page, $query, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listProduct' + * + * @param int $page (optional) + * @param int $per_page (optional, default to 25) + * @param string $query (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listProductRequest($page = null, $per_page = 25, $query = null, string $contentType = self::contentTypes['listProduct'][0]) + { + + + if ($per_page !== null && $per_page > 100) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling ProductApi.listProduct, must be smaller than or equal to 100.'); + } + if ($per_page !== null && $per_page < 1) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling ProductApi.listProduct, must be bigger than or equal to 1.'); + } + + + + $resourcePath = '/products'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $per_page, + 'per_page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $query, + 'query', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateProduct + * + * Update a product + * + * @param int $id id (required) + * @param \Cone\Billingo\Model\Product $product Product object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProduct'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Product|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function updateProduct($id, $product, string $contentType = self::contentTypes['updateProduct'][0]) + { + list($response) = $this->updateProductWithHttpInfo($id, $product, $contentType); + return $response; + } + + /** + * Operation updateProductWithHttpInfo + * + * Update a product + * + * @param int $id (required) + * @param \Cone\Billingo\Model\Product $product Product object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProduct'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Product|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function updateProductWithHttpInfo($id, $product, string $contentType = self::contentTypes['updateProduct'][0]) + { + $request = $this->updateProductRequest($id, $product, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\Product' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Product' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Product', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Product'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Product', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateProductAsync + * + * Update a product + * + * @param int $id (required) + * @param \Cone\Billingo\Model\Product $product Product object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateProductAsync($id, $product, string $contentType = self::contentTypes['updateProduct'][0]) + { + return $this->updateProductAsyncWithHttpInfo($id, $product, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateProductAsyncWithHttpInfo + * + * Update a product + * + * @param int $id (required) + * @param \Cone\Billingo\Model\Product $product Product object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateProductAsyncWithHttpInfo($id, $product, string $contentType = self::contentTypes['updateProduct'][0]) + { + $returnType = '\Cone\Billingo\Model\Product'; + $request = $this->updateProductRequest($id, $product, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateProduct' + * + * @param int $id (required) + * @param \Cone\Billingo\Model\Product $product Product object that you would like to update. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProduct'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateProductRequest($id, $product, string $contentType = self::contentTypes['updateProduct'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateProduct' + ); + } + + // verify the required parameter 'product' is set + if ($product === null || (is_array($product) && count($product) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $product when calling updateProduct' + ); + } + + + $resourcePath = '/products/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($product)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($product)); + } else { + $httpBody = $product; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/SpendingApi.php b/lib/Api/SpendingApi.php new file mode 100644 index 0000000..4b5fc2c --- /dev/null +++ b/lib/Api/SpendingApi.php @@ -0,0 +1,2399 @@ + [ + 'application/json', + ], + 'spendingList' => [ + 'application/json', + ], + 'spendingSave' => [ + 'application/json', + ], + 'spendingShow' => [ + 'application/json', + ], + 'spendingUpdate' => [ + 'application/json', + ], + ]; + +/** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation spendingDelete + * + * Deletes a spending. + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingDelete'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function spendingDelete($id, string $contentType = self::contentTypes['spendingDelete'][0]) + { + $this->spendingDeleteWithHttpInfo($id, $contentType); + } + + /** + * Operation spendingDeleteWithHttpInfo + * + * Deletes a spending. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingDelete'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function spendingDeleteWithHttpInfo($id, string $contentType = self::contentTypes['spendingDelete'][0]) + { + $request = $this->spendingDeleteRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation spendingDeleteAsync + * + * Deletes a spending. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingDelete'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function spendingDeleteAsync($id, string $contentType = self::contentTypes['spendingDelete'][0]) + { + return $this->spendingDeleteAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation spendingDeleteAsyncWithHttpInfo + * + * Deletes a spending. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingDelete'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function spendingDeleteAsyncWithHttpInfo($id, string $contentType = self::contentTypes['spendingDelete'][0]) + { + $returnType = ''; + $request = $this->spendingDeleteRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'spendingDelete' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingDelete'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function spendingDeleteRequest($id, string $contentType = self::contentTypes['spendingDelete'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling spendingDelete' + ); + } + + + $resourcePath = '/spendings/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation spendingList + * + * Lists all spending + * + * @param string $q q (optional, default to '') + * @param int $page page (optional, default to 1) + * @param int $per_page per_page (optional, default to 25) + * @param DateType $spending_date spending_date (optional) + * @param string $start_date start_date (optional) + * @param string $end_date end_date (optional) + * @param PaymentStatusSpending $payment_status payment_status (optional) + * @param Source $spending_type spending_type (optional) + * @param Category $categories categories (optional) + * @param Currency $currencies currencies (optional) + * @param PaymentMethod $payment_methods payment_methods (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingList'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\SpendingList|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function spendingList($q = '', $page = 1, $per_page = 25, $spending_date = null, $start_date = null, $end_date = null, $payment_status = null, $spending_type = null, $categories = null, $currencies = null, $payment_methods = null, string $contentType = self::contentTypes['spendingList'][0]) + { + list($response) = $this->spendingListWithHttpInfo($q, $page, $per_page, $spending_date, $start_date, $end_date, $payment_status, $spending_type, $categories, $currencies, $payment_methods, $contentType); + return $response; + } + + /** + * Operation spendingListWithHttpInfo + * + * Lists all spending + * + * @param string $q (optional, default to '') + * @param int $page (optional, default to 1) + * @param int $per_page (optional, default to 25) + * @param DateType $spending_date (optional) + * @param string $start_date (optional) + * @param string $end_date (optional) + * @param PaymentStatusSpending $payment_status (optional) + * @param Source $spending_type (optional) + * @param Category $categories (optional) + * @param Currency $currencies (optional) + * @param PaymentMethod $payment_methods (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingList'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\SpendingList|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function spendingListWithHttpInfo($q = '', $page = 1, $per_page = 25, $spending_date = null, $start_date = null, $end_date = null, $payment_status = null, $spending_type = null, $categories = null, $currencies = null, $payment_methods = null, string $contentType = self::contentTypes['spendingList'][0]) + { + $request = $this->spendingListRequest($q, $page, $per_page, $spending_date, $start_date, $end_date, $payment_status, $spending_type, $categories, $currencies, $payment_methods, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\SpendingList' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SpendingList' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SpendingList', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\SpendingList'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SpendingList', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation spendingListAsync + * + * Lists all spending + * + * @param string $q (optional, default to '') + * @param int $page (optional, default to 1) + * @param int $per_page (optional, default to 25) + * @param DateType $spending_date (optional) + * @param string $start_date (optional) + * @param string $end_date (optional) + * @param PaymentStatusSpending $payment_status (optional) + * @param Source $spending_type (optional) + * @param Category $categories (optional) + * @param Currency $currencies (optional) + * @param PaymentMethod $payment_methods (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingList'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function spendingListAsync($q = '', $page = 1, $per_page = 25, $spending_date = null, $start_date = null, $end_date = null, $payment_status = null, $spending_type = null, $categories = null, $currencies = null, $payment_methods = null, string $contentType = self::contentTypes['spendingList'][0]) + { + return $this->spendingListAsyncWithHttpInfo($q, $page, $per_page, $spending_date, $start_date, $end_date, $payment_status, $spending_type, $categories, $currencies, $payment_methods, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation spendingListAsyncWithHttpInfo + * + * Lists all spending + * + * @param string $q (optional, default to '') + * @param int $page (optional, default to 1) + * @param int $per_page (optional, default to 25) + * @param DateType $spending_date (optional) + * @param string $start_date (optional) + * @param string $end_date (optional) + * @param PaymentStatusSpending $payment_status (optional) + * @param Source $spending_type (optional) + * @param Category $categories (optional) + * @param Currency $currencies (optional) + * @param PaymentMethod $payment_methods (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingList'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function spendingListAsyncWithHttpInfo($q = '', $page = 1, $per_page = 25, $spending_date = null, $start_date = null, $end_date = null, $payment_status = null, $spending_type = null, $categories = null, $currencies = null, $payment_methods = null, string $contentType = self::contentTypes['spendingList'][0]) + { + $returnType = '\Cone\Billingo\Model\SpendingList'; + $request = $this->spendingListRequest($q, $page, $per_page, $spending_date, $start_date, $end_date, $payment_status, $spending_type, $categories, $currencies, $payment_methods, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'spendingList' + * + * @param string $q (optional, default to '') + * @param int $page (optional, default to 1) + * @param int $per_page (optional, default to 25) + * @param DateType $spending_date (optional) + * @param string $start_date (optional) + * @param string $end_date (optional) + * @param PaymentStatusSpending $payment_status (optional) + * @param Source $spending_type (optional) + * @param Category $categories (optional) + * @param Currency $currencies (optional) + * @param PaymentMethod $payment_methods (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingList'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function spendingListRequest($q = '', $page = 1, $per_page = 25, $spending_date = null, $start_date = null, $end_date = null, $payment_status = null, $spending_type = null, $categories = null, $currencies = null, $payment_methods = null, string $contentType = self::contentTypes['spendingList'][0]) + { + + + + if ($per_page !== null && $per_page > 100) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling SpendingApi.spendingList, must be smaller than or equal to 100.'); + } + if ($per_page !== null && $per_page < 1) { + throw new \InvalidArgumentException('invalid value for "$per_page" when calling SpendingApi.spendingList, must be bigger than or equal to 1.'); + } + + + + + + + + + + + $resourcePath = '/spendings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $q, + 'q', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $per_page, + 'per_page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $spending_date, + 'spending_date', // param base name + 'DateType', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'start_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'end_date', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payment_status, + 'payment_status', // param base name + 'PaymentStatusSpending', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $spending_type, + 'spending_type', // param base name + 'Source', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $categories, + 'categories', // param base name + 'Category', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $currencies, + 'currencies', // param base name + 'Currency', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payment_methods, + 'payment_methods', // param base name + 'PaymentMethod', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation spendingSave + * + * Creates a new spending. + * + * @param \Cone\Billingo\Model\SpendingSave $spending_save spending_save (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingSave'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Spending|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function spendingSave($spending_save = null, string $contentType = self::contentTypes['spendingSave'][0]) + { + list($response) = $this->spendingSaveWithHttpInfo($spending_save, $contentType); + return $response; + } + + /** + * Operation spendingSaveWithHttpInfo + * + * Creates a new spending. + * + * @param \Cone\Billingo\Model\SpendingSave $spending_save (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingSave'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Spending|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function spendingSaveWithHttpInfo($spending_save = null, string $contentType = self::contentTypes['spendingSave'][0]) + { + $request = $this->spendingSaveRequest($spending_save, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 201: + if ('\Cone\Billingo\Model\Spending' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Spending' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Spending', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Spending'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Spending', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation spendingSaveAsync + * + * Creates a new spending. + * + * @param \Cone\Billingo\Model\SpendingSave $spending_save (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingSave'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function spendingSaveAsync($spending_save = null, string $contentType = self::contentTypes['spendingSave'][0]) + { + return $this->spendingSaveAsyncWithHttpInfo($spending_save, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation spendingSaveAsyncWithHttpInfo + * + * Creates a new spending. + * + * @param \Cone\Billingo\Model\SpendingSave $spending_save (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingSave'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function spendingSaveAsyncWithHttpInfo($spending_save = null, string $contentType = self::contentTypes['spendingSave'][0]) + { + $returnType = '\Cone\Billingo\Model\Spending'; + $request = $this->spendingSaveRequest($spending_save, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'spendingSave' + * + * @param \Cone\Billingo\Model\SpendingSave $spending_save (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingSave'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function spendingSaveRequest($spending_save = null, string $contentType = self::contentTypes['spendingSave'][0]) + { + + + + $resourcePath = '/spendings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($spending_save)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($spending_save)); + } else { + $httpBody = $spending_save; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation spendingShow + * + * Retrieves one specific spending. + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingShow'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Spending|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function spendingShow($id, string $contentType = self::contentTypes['spendingShow'][0]) + { + list($response) = $this->spendingShowWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation spendingShowWithHttpInfo + * + * Retrieves one specific spending. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingShow'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Spending|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function spendingShowWithHttpInfo($id, string $contentType = self::contentTypes['spendingShow'][0]) + { + $request = $this->spendingShowRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\Spending' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Spending' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Spending', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Spending'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Spending', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation spendingShowAsync + * + * Retrieves one specific spending. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingShow'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function spendingShowAsync($id, string $contentType = self::contentTypes['spendingShow'][0]) + { + return $this->spendingShowAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation spendingShowAsyncWithHttpInfo + * + * Retrieves one specific spending. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingShow'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function spendingShowAsyncWithHttpInfo($id, string $contentType = self::contentTypes['spendingShow'][0]) + { + $returnType = '\Cone\Billingo\Model\Spending'; + $request = $this->spendingShowRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'spendingShow' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingShow'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function spendingShowRequest($id, string $contentType = self::contentTypes['spendingShow'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling spendingShow' + ); + } + + + $resourcePath = '/spendings/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation spendingUpdate + * + * Updates a spending item. + * + * @param int $id id (required) + * @param \Cone\Billingo\Model\SpendingSave $spending_save spending_save (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingUpdate'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Spending|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function spendingUpdate($id, $spending_save = null, string $contentType = self::contentTypes['spendingUpdate'][0]) + { + list($response) = $this->spendingUpdateWithHttpInfo($id, $spending_save, $contentType); + return $response; + } + + /** + * Operation spendingUpdateWithHttpInfo + * + * Updates a spending item. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\SpendingSave $spending_save (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingUpdate'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Spending|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function spendingUpdateWithHttpInfo($id, $spending_save = null, string $contentType = self::contentTypes['spendingUpdate'][0]) + { + $request = $this->spendingUpdateRequest($id, $spending_save, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\Spending' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Spending' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Spending', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Spending'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Spending', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation spendingUpdateAsync + * + * Updates a spending item. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\SpendingSave $spending_save (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingUpdate'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function spendingUpdateAsync($id, $spending_save = null, string $contentType = self::contentTypes['spendingUpdate'][0]) + { + return $this->spendingUpdateAsyncWithHttpInfo($id, $spending_save, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation spendingUpdateAsyncWithHttpInfo + * + * Updates a spending item. + * + * @param int $id (required) + * @param \Cone\Billingo\Model\SpendingSave $spending_save (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingUpdate'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function spendingUpdateAsyncWithHttpInfo($id, $spending_save = null, string $contentType = self::contentTypes['spendingUpdate'][0]) + { + $returnType = '\Cone\Billingo\Model\Spending'; + $request = $this->spendingUpdateRequest($id, $spending_save, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'spendingUpdate' + * + * @param int $id (required) + * @param \Cone\Billingo\Model\SpendingSave $spending_save (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['spendingUpdate'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function spendingUpdateRequest($id, $spending_save = null, string $contentType = self::contentTypes['spendingUpdate'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling spendingUpdate' + ); + } + + + + $resourcePath = '/spendings/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($spending_save)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($spending_save)); + } else { + $httpBody = $spending_save; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/UtilApi.php b/lib/Api/UtilApi.php new file mode 100644 index 0000000..097ed8c --- /dev/null +++ b/lib/Api/UtilApi.php @@ -0,0 +1,1434 @@ + [ + 'application/json', + ], + 'getId' => [ + 'application/json', + ], + 'getServerTime' => [ + 'application/json', + ], + ]; + +/** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation checkTaxNumber + * + * Check tax number. + * + * @param string $tax_number tax_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkTaxNumber'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\TaxNumber|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function checkTaxNumber($tax_number, string $contentType = self::contentTypes['checkTaxNumber'][0]) + { + list($response) = $this->checkTaxNumberWithHttpInfo($tax_number, $contentType); + return $response; + } + + /** + * Operation checkTaxNumberWithHttpInfo + * + * Check tax number. + * + * @param string $tax_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkTaxNumber'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\TaxNumber|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function checkTaxNumberWithHttpInfo($tax_number, string $contentType = self::contentTypes['checkTaxNumber'][0]) + { + $request = $this->checkTaxNumberRequest($tax_number, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\TaxNumber' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TaxNumber' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TaxNumber', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\TaxNumber'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TaxNumber', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation checkTaxNumberAsync + * + * Check tax number. + * + * @param string $tax_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkTaxNumber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function checkTaxNumberAsync($tax_number, string $contentType = self::contentTypes['checkTaxNumber'][0]) + { + return $this->checkTaxNumberAsyncWithHttpInfo($tax_number, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation checkTaxNumberAsyncWithHttpInfo + * + * Check tax number. + * + * @param string $tax_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkTaxNumber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function checkTaxNumberAsyncWithHttpInfo($tax_number, string $contentType = self::contentTypes['checkTaxNumber'][0]) + { + $returnType = '\Cone\Billingo\Model\TaxNumber'; + $request = $this->checkTaxNumberRequest($tax_number, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'checkTaxNumber' + * + * @param string $tax_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['checkTaxNumber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function checkTaxNumberRequest($tax_number, string $contentType = self::contentTypes['checkTaxNumber'][0]) + { + + // verify the required parameter 'tax_number' is set + if ($tax_number === null || (is_array($tax_number) && count($tax_number) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tax_number when calling checkTaxNumber' + ); + } + if (!preg_match("/^([0-9]{8})-([12345])-([0-9]{2})$/", $tax_number)) { + throw new \InvalidArgumentException("invalid value for \"tax_number\" when calling UtilApi.checkTaxNumber, must conform to the pattern /^([0-9]{8})-([12345])-([0-9]{2})$/."); + } + + + $resourcePath = '/utils/check-tax-number/{tax_number}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($tax_number !== null) { + $resourcePath = str_replace( + '{' . 'tax_number' . '}', + ObjectSerializer::toPathValue($tax_number), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getId + * + * Convert legacy ID to v3 ID. + * + * @param int $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getId'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\Id|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse + */ + public function getId($id, string $contentType = self::contentTypes['getId'][0]) + { + list($response) = $this->getIdWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation getIdWithHttpInfo + * + * Convert legacy ID to v3 ID. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getId'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\Id|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse|\Cone\Billingo\Model\ClientErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getIdWithHttpInfo($id, string $contentType = self::contentTypes['getId'][0]) + { + $request = $this->getIdRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\Id' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\Id' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\Id', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\Id'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\Id', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getIdAsync + * + * Convert legacy ID to v3 ID. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getId'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getIdAsync($id, string $contentType = self::contentTypes['getId'][0]) + { + return $this->getIdAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getIdAsyncWithHttpInfo + * + * Convert legacy ID to v3 ID. + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getId'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getIdAsyncWithHttpInfo($id, string $contentType = self::contentTypes['getId'][0]) + { + $returnType = '\Cone\Billingo\Model\Id'; + $request = $this->getIdRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getId' + * + * @param int $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getId'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getIdRequest($id, string $contentType = self::contentTypes['getId'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getId' + ); + } + + + $resourcePath = '/utils/convert-legacy-id/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getServerTime + * + * Get the server time + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getServerTime'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Cone\Billingo\Model\ServerTime|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse + */ + public function getServerTime(string $contentType = self::contentTypes['getServerTime'][0]) + { + list($response) = $this->getServerTimeWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getServerTimeWithHttpInfo + * + * Get the server time + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getServerTime'] to see the possible values for this operation + * + * @throws \Cone\Billingo\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Cone\Billingo\Model\ServerTime|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\ClientErrorResponse|\Cone\Billingo\Model\SubscriptionErrorResponse|\Cone\Billingo\Model\ValidationErrorResponse|\Cone\Billingo\Model\TooManyRequestsResponse|\Cone\Billingo\Model\ServerErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getServerTimeWithHttpInfo(string $contentType = self::contentTypes['getServerTime'][0]) + { + $request = $this->getServerTimeRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Cone\Billingo\Model\ServerTime' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerTime' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerTime', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Cone\Billingo\Model\ClientErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ClientErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ClientErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\SubscriptionErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\SubscriptionErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\Cone\Billingo\Model\ValidationErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ValidationErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ValidationErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\Cone\Billingo\Model\TooManyRequestsResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\TooManyRequestsResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\TooManyRequestsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Cone\Billingo\Model\ServerErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Cone\Billingo\Model\ServerErrorResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\Cone\Billingo\Model\ServerErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Cone\Billingo\Model\ServerTime'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerTime', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ClientErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\SubscriptionErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ValidationErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\TooManyRequestsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Cone\Billingo\Model\ServerErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getServerTimeAsync + * + * Get the server time + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getServerTime'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getServerTimeAsync(string $contentType = self::contentTypes['getServerTime'][0]) + { + return $this->getServerTimeAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getServerTimeAsyncWithHttpInfo + * + * Get the server time + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getServerTime'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getServerTimeAsyncWithHttpInfo(string $contentType = self::contentTypes['getServerTime'][0]) + { + $returnType = '\Cone\Billingo\Model\ServerTime'; + $request = $this->getServerTimeRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getServerTime' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getServerTime'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getServerTimeRequest(string $contentType = self::contentTypes['getServerTime'][0]) + { + + + $resourcePath = '/utils/time'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY'); + if ($apiKey !== null) { + $headers['X-API-KEY'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/ApiException.php b/lib/ApiException.php new file mode 100644 index 0000000..374f437 --- /dev/null +++ b/lib/ApiException.php @@ -0,0 +1,120 @@ +responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return string[]|null HTTP response header + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Sets the deserialized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deserialized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/lib/Configuration.php b/lib/Configuration.php new file mode 100644 index 0000000..7cbe2e1 --- /dev/null +++ b/lib/Configuration.php @@ -0,0 +1,532 @@ +tempFolderPath = sys_get_temp_dir(); + } + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets boolean format for query string. + * + * @param string $booleanFormatForQueryString Boolean format for query string + * + * @return $this + */ + public function setBooleanFormatForQueryString(string $booleanFormat) + { + $this->booleanFormatForQueryString = $booleanFormat; + + return $this; + } + + /** + * Gets boolean format for query string. + * + * @return string Boolean format for query string + */ + public function getBooleanFormatForQueryString(): string + { + return $this->booleanFormatForQueryString; + } + + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Gets the username for HTTP basic authentication + * + * @return string Username for HTTP basic authentication + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug($debug) + { + $this->debug = $debug; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile($debugFile) + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile() + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration() + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the default configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config) + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport() + { + $report = 'PHP SDK (Cone\Billingo) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' The version of the OpenAPI document: 3.0.15' . PHP_EOL; + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return null|string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } + + /** + * Returns an array of host settings + * + * @return array an array of host settings + */ + public function getHostSettings() + { + return [ + [ + "url" => "https://api.billingo.hu/v3", + "description" => "Billingo API", + ] + ]; + } + + /** + * Returns URL based on host settings, index and variables + * + * @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients + * @param int $hostIndex index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public static function getHostString(array $hostsSettings, $hostIndex, array $variables = null) + { + if (null === $variables) { + $variables = []; + } + + // check array index out of bound + if ($hostIndex < 0 || $hostIndex >= count($hostsSettings)) { + throw new \InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostsSettings)); + } + + $host = $hostsSettings[$hostIndex]; + $url = $host["url"]; + + // go through variable and assign a value + foreach ($host["variables"] ?? [] as $name => $variable) { + if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user + if (!isset($variable['enum_values']) || in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum + $url = str_replace("{".$name."}", $variables[$name], $url); + } else { + throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); + } + } else { + // use default value + $url = str_replace("{".$name."}", $variable["default_value"], $url); + } + } + + return $url; + } + + /** + * Returns URL based on the index and variables + * + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public function getHostFromSettings($index, $variables = null) + { + return self::getHostString($this->getHostSettings(), $index, $variables); + } +} diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php new file mode 100644 index 0000000..a9965fe --- /dev/null +++ b/lib/HeaderSelector.php @@ -0,0 +1,246 @@ +selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + if (!$isMultipart) { + if($contentType === '') { + $contentType = 'application/json'; + } + + $headers['Content-Type'] = $contentType; + } + + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided. + * + * @param string[] $accept Array of header + * + * @return null|string Accept (e.g. application/json) + */ + private function selectAcceptHeader(array $accept): ?string + { + # filter out empty entries + $accept = array_filter($accept); + + if (count($accept) === 0) { + return null; + } + + # If there's only one Accept header, just use it + if (count($accept) === 1) { + return reset($accept); + } + + # If none of the available Accept headers is of type "json", then just use all them + $headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept); + if (count($headersWithJson) === 0) { + return implode(',', $accept); + } + + # If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1, + # to give the highest priority to json-like headers - recalculating the existing ones, if needed + return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); + } + + /** + * Create an Accept header string from the given "Accept" headers array, recalculating all weights + * + * @param string[] $accept Array of Accept Headers + * @param string[] $headersWithJson Array of Accept Headers of type "json" + * + * @return string "Accept" Header (e.g. "application/json, text/html; q=0.9") + */ + private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string + { + $processedHeaders = [ + 'withApplicationJson' => [], + 'withJson' => [], + 'withoutJson' => [], + ]; + + foreach ($accept as $header) { + + $headerData = $this->getHeaderAndWeight($header); + + if (stripos($headerData['header'], 'application/json') === 0) { + $processedHeaders['withApplicationJson'][] = $headerData; + } elseif (in_array($header, $headersWithJson, true)) { + $processedHeaders['withJson'][] = $headerData; + } else { + $processedHeaders['withoutJson'][] = $headerData; + } + } + + $acceptHeaders = []; + $currentWeight = 1000; + + $hasMoreThan28Headers = count($accept) > 28; + + foreach($processedHeaders as $headers) { + if (count($headers) > 0) { + $acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers); + } + } + + $acceptHeaders = array_merge(...$acceptHeaders); + + return implode(',', $acceptHeaders); + } + + /** + * Given an Accept header, returns an associative array splitting the header and its weight + * + * @param string $header "Accept" Header + * + * @return array with the header and its weight + */ + private function getHeaderAndWeight(string $header): array + { + # matches headers with weight, splitting the header and the weight in $outputArray + if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) { + $headerData = [ + 'header' => $outputArray[1], + 'weight' => (int)($outputArray[2] * 1000), + ]; + } else { + $headerData = [ + 'header' => trim($header), + 'weight' => 1000, + ]; + } + + return $headerData; + } + + /** + * @param array[] $headers + * @param float $currentWeight + * @param bool $hasMoreThan28Headers + * @return string[] array of adjusted "Accept" headers + */ + private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array + { + usort($headers, function (array $a, array $b) { + return $b['weight'] - $a['weight']; + }); + + $acceptHeaders = []; + foreach ($headers as $index => $header) { + if($index > 0 && $headers[$index - 1]['weight'] > $header['weight']) + { + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + } + + $weight = $currentWeight; + + $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight); + } + + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + + return $acceptHeaders; + } + + /** + * @param string $header + * @param int $weight + * @return string + */ + private function buildAcceptHeader(string $header, int $weight): string + { + if($weight === 1000) { + return $header; + } + + return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0'); + } + + /** + * Calculate the next weight, based on the current one. + * + * If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the + * following formula: + * + * next weight = current weight - 10 ^ (floor(log(current weight - 1))) + * + * ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) ) + * + * Starting from 1000, this generates the following series: + * + * 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 + * + * The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works + * if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1 + * decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc. + * + * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value) + * @param bool $hasMoreThan28Headers + * @return int + */ + public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int + { + if ($currentWeight <= 1) { + return 1; + } + + if ($hasMoreThan28Headers) { + return $currentWeight - 1; + } + + return $currentWeight - 10 ** floor( log10($currentWeight - 1) ); + } +} diff --git a/lib/Model/Address.php b/lib/Model/Address.php new file mode 100644 index 0000000..72a0316 --- /dev/null +++ b/lib/Model/Address.php @@ -0,0 +1,524 @@ + + */ +class Address implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'country_code' => '\Cone\Billingo\Model\Country', + 'post_code' => 'string', + 'city' => 'string', + 'address' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'country_code' => null, + 'post_code' => null, + 'city' => null, + 'address' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'country_code' => false, + 'post_code' => false, + 'city' => false, + 'address' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country_code' => 'country_code', + 'post_code' => 'post_code', + 'city' => 'city', + 'address' => 'address' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country_code' => 'setCountryCode', + 'post_code' => 'setPostCode', + 'city' => 'setCity', + 'address' => 'setAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country_code' => 'getCountryCode', + 'post_code' => 'getPostCode', + 'city' => 'getCity', + 'address' => 'getAddress' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('post_code', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['country_code'] === null) { + $invalidProperties[] = "'country_code' can't be null"; + } + if ($this->container['post_code'] === null) { + $invalidProperties[] = "'post_code' can't be null"; + } + if ($this->container['city'] === null) { + $invalidProperties[] = "'city' can't be null"; + } + if ($this->container['address'] === null) { + $invalidProperties[] = "'address' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets country_code + * + * @return \Cone\Billingo\Model\Country + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param \Cone\Billingo\Model\Country $country_code country_code + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets post_code + * + * @return string + */ + public function getPostCode() + { + return $this->container['post_code']; + } + + /** + * Sets post_code + * + * @param string $post_code post_code + * + * @return self + */ + public function setPostCode($post_code) + { + if (is_null($post_code)) { + throw new \InvalidArgumentException('non-nullable post_code cannot be null'); + } + $this->container['post_code'] = $post_code; + + return $this; + } + + /** + * Gets city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city city + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets address + * + * @return string + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/BankAccount.php b/lib/Model/BankAccount.php new file mode 100644 index 0000000..aea504a --- /dev/null +++ b/lib/Model/BankAccount.php @@ -0,0 +1,625 @@ + + */ +class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BankAccount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'account_number' => 'string', + 'account_number_iban' => 'string', + 'swift' => 'string', + 'currency' => '\Cone\Billingo\Model\Currency', + 'need_qr' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'account_number' => null, + 'account_number_iban' => null, + 'swift' => null, + 'currency' => null, + 'need_qr' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'account_number' => false, + 'account_number_iban' => false, + 'swift' => false, + 'currency' => false, + 'need_qr' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'account_number' => 'account_number', + 'account_number_iban' => 'account_number_iban', + 'swift' => 'swift', + 'currency' => 'currency', + 'need_qr' => 'need_qr' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'account_number' => 'setAccountNumber', + 'account_number_iban' => 'setAccountNumberIban', + 'swift' => 'setSwift', + 'currency' => 'setCurrency', + 'need_qr' => 'setNeedQr' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'account_number' => 'getAccountNumber', + 'account_number_iban' => 'getAccountNumberIban', + 'swift' => 'getSwift', + 'currency' => 'getCurrency', + 'need_qr' => 'getNeedQr' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('account_number_iban', $data ?? [], null); + $this->setIfExists('swift', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('need_qr', $data ?? [], false); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number account_number + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets account_number_iban + * + * @return string|null + */ + public function getAccountNumberIban() + { + return $this->container['account_number_iban']; + } + + /** + * Sets account_number_iban + * + * @param string|null $account_number_iban account_number_iban + * + * @return self + */ + public function setAccountNumberIban($account_number_iban) + { + if (is_null($account_number_iban)) { + throw new \InvalidArgumentException('non-nullable account_number_iban cannot be null'); + } + $this->container['account_number_iban'] = $account_number_iban; + + return $this; + } + + /** + * Gets swift + * + * @return string|null + */ + public function getSwift() + { + return $this->container['swift']; + } + + /** + * Sets swift + * + * @param string|null $swift swift + * + * @return self + */ + public function setSwift($swift) + { + if (is_null($swift)) { + throw new \InvalidArgumentException('non-nullable swift cannot be null'); + } + $this->container['swift'] = $swift; + + return $this; + } + + /** + * Gets currency + * + * @return \Cone\Billingo\Model\Currency + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param \Cone\Billingo\Model\Currency $currency currency + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets need_qr + * + * @return bool|null + * @deprecated + */ + public function getNeedQr() + { + return $this->container['need_qr']; + } + + /** + * Sets need_qr + * + * @param bool|null $need_qr need_qr + * + * @return self + * @deprecated + */ + public function setNeedQr($need_qr) + { + if (is_null($need_qr)) { + throw new \InvalidArgumentException('non-nullable need_qr cannot be null'); + } + $this->container['need_qr'] = $need_qr; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/BankAccountList.php b/lib/Model/BankAccountList.php new file mode 100644 index 0000000..fa37605 --- /dev/null +++ b/lib/Model/BankAccountList.php @@ -0,0 +1,615 @@ + + */ +class BankAccountList implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BankAccountList'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Cone\Billingo\Model\BankAccount[]', + 'total' => 'int', + 'per_page' => 'int', + 'current_page' => 'int', + 'last_page' => 'int', + 'prev_page_url' => 'string', + 'next_page_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'total' => null, + 'per_page' => null, + 'current_page' => null, + 'last_page' => null, + 'prev_page_url' => null, + 'next_page_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false, + 'total' => false, + 'per_page' => false, + 'current_page' => false, + 'last_page' => false, + 'prev_page_url' => false, + 'next_page_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'total' => 'total', + 'per_page' => 'per_page', + 'current_page' => 'current_page', + 'last_page' => 'last_page', + 'prev_page_url' => 'prev_page_url', + 'next_page_url' => 'next_page_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'total' => 'setTotal', + 'per_page' => 'setPerPage', + 'current_page' => 'setCurrentPage', + 'last_page' => 'setLastPage', + 'prev_page_url' => 'setPrevPageUrl', + 'next_page_url' => 'setNextPageUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'total' => 'getTotal', + 'per_page' => 'getPerPage', + 'current_page' => 'getCurrentPage', + 'last_page' => 'getLastPage', + 'prev_page_url' => 'getPrevPageUrl', + 'next_page_url' => 'getNextPageUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('per_page', $data ?? [], null); + $this->setIfExists('current_page', $data ?? [], null); + $this->setIfExists('last_page', $data ?? [], null); + $this->setIfExists('prev_page_url', $data ?? [], null); + $this->setIfExists('next_page_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Cone\Billingo\Model\BankAccount[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Cone\Billingo\Model\BankAccount[]|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets total + * + * @return int|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int|null $total total + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets per_page + * + * @return int|null + */ + public function getPerPage() + { + return $this->container['per_page']; + } + + /** + * Sets per_page + * + * @param int|null $per_page per_page + * + * @return self + */ + public function setPerPage($per_page) + { + if (is_null($per_page)) { + throw new \InvalidArgumentException('non-nullable per_page cannot be null'); + } + $this->container['per_page'] = $per_page; + + return $this; + } + + /** + * Gets current_page + * + * @return int|null + */ + public function getCurrentPage() + { + return $this->container['current_page']; + } + + /** + * Sets current_page + * + * @param int|null $current_page current_page + * + * @return self + */ + public function setCurrentPage($current_page) + { + if (is_null($current_page)) { + throw new \InvalidArgumentException('non-nullable current_page cannot be null'); + } + $this->container['current_page'] = $current_page; + + return $this; + } + + /** + * Gets last_page + * + * @return int|null + */ + public function getLastPage() + { + return $this->container['last_page']; + } + + /** + * Sets last_page + * + * @param int|null $last_page last_page + * + * @return self + */ + public function setLastPage($last_page) + { + if (is_null($last_page)) { + throw new \InvalidArgumentException('non-nullable last_page cannot be null'); + } + $this->container['last_page'] = $last_page; + + return $this; + } + + /** + * Gets prev_page_url + * + * @return string|null + */ + public function getPrevPageUrl() + { + return $this->container['prev_page_url']; + } + + /** + * Sets prev_page_url + * + * @param string|null $prev_page_url prev_page_url + * + * @return self + */ + public function setPrevPageUrl($prev_page_url) + { + if (is_null($prev_page_url)) { + throw new \InvalidArgumentException('non-nullable prev_page_url cannot be null'); + } + $this->container['prev_page_url'] = $prev_page_url; + + return $this; + } + + /** + * Gets next_page_url + * + * @return string|null + */ + public function getNextPageUrl() + { + return $this->container['next_page_url']; + } + + /** + * Sets next_page_url + * + * @param string|null $next_page_url next_page_url + * + * @return self + */ + public function setNextPageUrl($next_page_url) + { + if (is_null($next_page_url)) { + throw new \InvalidArgumentException('non-nullable next_page_url cannot be null'); + } + $this->container['next_page_url'] = $next_page_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Category.php b/lib/Model/Category.php new file mode 100644 index 0000000..4decae1 --- /dev/null +++ b/lib/Model/Category.php @@ -0,0 +1,78 @@ + + */ +class ClientError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ClientError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ClientErrorResponse.php b/lib/Model/ClientErrorResponse.php new file mode 100644 index 0000000..7d642a0 --- /dev/null +++ b/lib/Model/ClientErrorResponse.php @@ -0,0 +1,410 @@ + + */ +class ClientErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ClientErrorResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'error' => '\Cone\Billingo\Model\ClientError' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'error' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'error' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'error' => 'error' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'error' => 'setError' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'error' => 'getError' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('error', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets error + * + * @return \Cone\Billingo\Model\ClientError|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param \Cone\Billingo\Model\ClientError|null $error error + * + * @return self + */ + public function setError($error) + { + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ConversationRate.php b/lib/Model/ConversationRate.php new file mode 100644 index 0000000..bbece3b --- /dev/null +++ b/lib/Model/ConversationRate.php @@ -0,0 +1,512 @@ + + */ +class ConversationRate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ConversationRate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'from_currency' => '\Cone\Billingo\Model\Currency', + 'to_currency' => '\Cone\Billingo\Model\Currency', + 'conversation_rate' => 'float', + 'date' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'from_currency' => null, + 'to_currency' => null, + 'conversation_rate' => 'float', + 'date' => 'date' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'from_currency' => false, + 'to_currency' => false, + 'conversation_rate' => false, + 'date' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'from_currency' => 'from_currency', + 'to_currency' => 'to_currency', + 'conversation_rate' => 'conversation_rate', + 'date' => 'date' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'from_currency' => 'setFromCurrency', + 'to_currency' => 'setToCurrency', + 'conversation_rate' => 'setConversationRate', + 'date' => 'setDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'from_currency' => 'getFromCurrency', + 'to_currency' => 'getToCurrency', + 'conversation_rate' => 'getConversationRate', + 'date' => 'getDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('from_currency', $data ?? [], null); + $this->setIfExists('to_currency', $data ?? [], null); + $this->setIfExists('conversation_rate', $data ?? [], null); + $this->setIfExists('date', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets from_currency + * + * @return \Cone\Billingo\Model\Currency|null + */ + public function getFromCurrency() + { + return $this->container['from_currency']; + } + + /** + * Sets from_currency + * + * @param \Cone\Billingo\Model\Currency|null $from_currency from_currency + * + * @return self + */ + public function setFromCurrency($from_currency) + { + if (is_null($from_currency)) { + throw new \InvalidArgumentException('non-nullable from_currency cannot be null'); + } + $this->container['from_currency'] = $from_currency; + + return $this; + } + + /** + * Gets to_currency + * + * @return \Cone\Billingo\Model\Currency|null + */ + public function getToCurrency() + { + return $this->container['to_currency']; + } + + /** + * Sets to_currency + * + * @param \Cone\Billingo\Model\Currency|null $to_currency to_currency + * + * @return self + */ + public function setToCurrency($to_currency) + { + if (is_null($to_currency)) { + throw new \InvalidArgumentException('non-nullable to_currency cannot be null'); + } + $this->container['to_currency'] = $to_currency; + + return $this; + } + + /** + * Gets conversation_rate + * + * @return float|null + */ + public function getConversationRate() + { + return $this->container['conversation_rate']; + } + + /** + * Sets conversation_rate + * + * @param float|null $conversation_rate conversation_rate + * + * @return self + */ + public function setConversationRate($conversation_rate) + { + if (is_null($conversation_rate)) { + throw new \InvalidArgumentException('non-nullable conversation_rate cannot be null'); + } + $this->container['conversation_rate'] = $conversation_rate; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime|null + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime|null $date date + * + * @return self + */ + public function setDate($date) + { + if (is_null($date)) { + throw new \InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CorrectionType.php b/lib/Model/CorrectionType.php new file mode 100644 index 0000000..f237cb9 --- /dev/null +++ b/lib/Model/CorrectionType.php @@ -0,0 +1,114 @@ + + */ +class CreateDocumentExport implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateDocumentExport'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'query_type' => '\Cone\Billingo\Model\DocumentExportQueryType', + 'start_date' => '\DateTime', + 'end_date' => '\DateTime', + 'document_block_id' => 'int', + 'export_type' => '\Cone\Billingo\Model\DocumentExportType', + 'number_start_year' => 'int', + 'number_start_sequence' => 'int', + 'number_end_year' => 'int', + 'number_end_sequence' => 'int', + 'payment_method' => '\Cone\Billingo\Model\PaymentMethod', + 'sort_by' => '\Cone\Billingo\Model\DocumentExportSortBy', + 'other_options' => '\Cone\Billingo\Model\DocumentExportOtherOptions', + 'filter_extra' => '\Cone\Billingo\Model\DocumentExportFilterExtra' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'query_type' => null, + 'start_date' => 'date', + 'end_date' => 'date', + 'document_block_id' => null, + 'export_type' => null, + 'number_start_year' => null, + 'number_start_sequence' => null, + 'number_end_year' => null, + 'number_end_sequence' => null, + 'payment_method' => null, + 'sort_by' => null, + 'other_options' => null, + 'filter_extra' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'query_type' => false, + 'start_date' => false, + 'end_date' => false, + 'document_block_id' => false, + 'export_type' => false, + 'number_start_year' => false, + 'number_start_sequence' => false, + 'number_end_year' => false, + 'number_end_sequence' => false, + 'payment_method' => false, + 'sort_by' => false, + 'other_options' => false, + 'filter_extra' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'query_type' => 'query_type', + 'start_date' => 'start_date', + 'end_date' => 'end_date', + 'document_block_id' => 'document_block_id', + 'export_type' => 'export_type', + 'number_start_year' => 'number_start_year', + 'number_start_sequence' => 'number_start_sequence', + 'number_end_year' => 'number_end_year', + 'number_end_sequence' => 'number_end_sequence', + 'payment_method' => 'payment_method', + 'sort_by' => 'sort_by', + 'other_options' => 'other_options', + 'filter_extra' => 'filter_extra' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query_type' => 'setQueryType', + 'start_date' => 'setStartDate', + 'end_date' => 'setEndDate', + 'document_block_id' => 'setDocumentBlockId', + 'export_type' => 'setExportType', + 'number_start_year' => 'setNumberStartYear', + 'number_start_sequence' => 'setNumberStartSequence', + 'number_end_year' => 'setNumberEndYear', + 'number_end_sequence' => 'setNumberEndSequence', + 'payment_method' => 'setPaymentMethod', + 'sort_by' => 'setSortBy', + 'other_options' => 'setOtherOptions', + 'filter_extra' => 'setFilterExtra' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query_type' => 'getQueryType', + 'start_date' => 'getStartDate', + 'end_date' => 'getEndDate', + 'document_block_id' => 'getDocumentBlockId', + 'export_type' => 'getExportType', + 'number_start_year' => 'getNumberStartYear', + 'number_start_sequence' => 'getNumberStartSequence', + 'number_end_year' => 'getNumberEndYear', + 'number_end_sequence' => 'getNumberEndSequence', + 'payment_method' => 'getPaymentMethod', + 'sort_by' => 'getSortBy', + 'other_options' => 'getOtherOptions', + 'filter_extra' => 'getFilterExtra' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('query_type', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('end_date', $data ?? [], null); + $this->setIfExists('document_block_id', $data ?? [], null); + $this->setIfExists('export_type', $data ?? [], null); + $this->setIfExists('number_start_year', $data ?? [], null); + $this->setIfExists('number_start_sequence', $data ?? [], null); + $this->setIfExists('number_end_year', $data ?? [], null); + $this->setIfExists('number_end_sequence', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('sort_by', $data ?? [], null); + $this->setIfExists('other_options', $data ?? [], null); + $this->setIfExists('filter_extra', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['query_type'] === null) { + $invalidProperties[] = "'query_type' can't be null"; + } + if ($this->container['start_date'] === null) { + $invalidProperties[] = "'start_date' can't be null"; + } + if ($this->container['end_date'] === null) { + $invalidProperties[] = "'end_date' can't be null"; + } + if ($this->container['export_type'] === null) { + $invalidProperties[] = "'export_type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets query_type + * + * @return \Cone\Billingo\Model\DocumentExportQueryType + */ + public function getQueryType() + { + return $this->container['query_type']; + } + + /** + * Sets query_type + * + * @param \Cone\Billingo\Model\DocumentExportQueryType $query_type query_type + * + * @return self + */ + public function setQueryType($query_type) + { + if (is_null($query_type)) { + throw new \InvalidArgumentException('non-nullable query_type cannot be null'); + } + $this->container['query_type'] = $query_type; + + return $this; + } + + /** + * Gets start_date + * + * @return \DateTime + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param \DateTime $start_date start_date + * + * @return self + */ + public function setStartDate($start_date) + { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } + $this->container['start_date'] = $start_date; + + return $this; + } + + /** + * Gets end_date + * + * @return \DateTime + */ + public function getEndDate() + { + return $this->container['end_date']; + } + + /** + * Sets end_date + * + * @param \DateTime $end_date end_date + * + * @return self + */ + public function setEndDate($end_date) + { + if (is_null($end_date)) { + throw new \InvalidArgumentException('non-nullable end_date cannot be null'); + } + $this->container['end_date'] = $end_date; + + return $this; + } + + /** + * Gets document_block_id + * + * @return int|null + */ + public function getDocumentBlockId() + { + return $this->container['document_block_id']; + } + + /** + * Sets document_block_id + * + * @param int|null $document_block_id document_block_id + * + * @return self + */ + public function setDocumentBlockId($document_block_id) + { + if (is_null($document_block_id)) { + throw new \InvalidArgumentException('non-nullable document_block_id cannot be null'); + } + $this->container['document_block_id'] = $document_block_id; + + return $this; + } + + /** + * Gets export_type + * + * @return \Cone\Billingo\Model\DocumentExportType + */ + public function getExportType() + { + return $this->container['export_type']; + } + + /** + * Sets export_type + * + * @param \Cone\Billingo\Model\DocumentExportType $export_type export_type + * + * @return self + */ + public function setExportType($export_type) + { + if (is_null($export_type)) { + throw new \InvalidArgumentException('non-nullable export_type cannot be null'); + } + $this->container['export_type'] = $export_type; + + return $this; + } + + /** + * Gets number_start_year + * + * @return int|null + */ + public function getNumberStartYear() + { + return $this->container['number_start_year']; + } + + /** + * Sets number_start_year + * + * @param int|null $number_start_year number_start_year + * + * @return self + */ + public function setNumberStartYear($number_start_year) + { + if (is_null($number_start_year)) { + throw new \InvalidArgumentException('non-nullable number_start_year cannot be null'); + } + $this->container['number_start_year'] = $number_start_year; + + return $this; + } + + /** + * Gets number_start_sequence + * + * @return int|null + */ + public function getNumberStartSequence() + { + return $this->container['number_start_sequence']; + } + + /** + * Sets number_start_sequence + * + * @param int|null $number_start_sequence number_start_sequence + * + * @return self + */ + public function setNumberStartSequence($number_start_sequence) + { + if (is_null($number_start_sequence)) { + throw new \InvalidArgumentException('non-nullable number_start_sequence cannot be null'); + } + $this->container['number_start_sequence'] = $number_start_sequence; + + return $this; + } + + /** + * Gets number_end_year + * + * @return int|null + */ + public function getNumberEndYear() + { + return $this->container['number_end_year']; + } + + /** + * Sets number_end_year + * + * @param int|null $number_end_year number_end_year + * + * @return self + */ + public function setNumberEndYear($number_end_year) + { + if (is_null($number_end_year)) { + throw new \InvalidArgumentException('non-nullable number_end_year cannot be null'); + } + $this->container['number_end_year'] = $number_end_year; + + return $this; + } + + /** + * Gets number_end_sequence + * + * @return int|null + */ + public function getNumberEndSequence() + { + return $this->container['number_end_sequence']; + } + + /** + * Sets number_end_sequence + * + * @param int|null $number_end_sequence number_end_sequence + * + * @return self + */ + public function setNumberEndSequence($number_end_sequence) + { + if (is_null($number_end_sequence)) { + throw new \InvalidArgumentException('non-nullable number_end_sequence cannot be null'); + } + $this->container['number_end_sequence'] = $number_end_sequence; + + return $this; + } + + /** + * Gets payment_method + * + * @return \Cone\Billingo\Model\PaymentMethod|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Cone\Billingo\Model\PaymentMethod|null $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets sort_by + * + * @return \Cone\Billingo\Model\DocumentExportSortBy|null + */ + public function getSortBy() + { + return $this->container['sort_by']; + } + + /** + * Sets sort_by + * + * @param \Cone\Billingo\Model\DocumentExportSortBy|null $sort_by sort_by + * + * @return self + */ + public function setSortBy($sort_by) + { + if (is_null($sort_by)) { + throw new \InvalidArgumentException('non-nullable sort_by cannot be null'); + } + $this->container['sort_by'] = $sort_by; + + return $this; + } + + /** + * Gets other_options + * + * @return \Cone\Billingo\Model\DocumentExportOtherOptions|null + */ + public function getOtherOptions() + { + return $this->container['other_options']; + } + + /** + * Sets other_options + * + * @param \Cone\Billingo\Model\DocumentExportOtherOptions|null $other_options other_options + * + * @return self + */ + public function setOtherOptions($other_options) + { + if (is_null($other_options)) { + throw new \InvalidArgumentException('non-nullable other_options cannot be null'); + } + $this->container['other_options'] = $other_options; + + return $this; + } + + /** + * Gets filter_extra + * + * @return \Cone\Billingo\Model\DocumentExportFilterExtra|null + */ + public function getFilterExtra() + { + return $this->container['filter_extra']; + } + + /** + * Sets filter_extra + * + * @param \Cone\Billingo\Model\DocumentExportFilterExtra|null $filter_extra filter_extra + * + * @return self + */ + public function setFilterExtra($filter_extra) + { + if (is_null($filter_extra)) { + throw new \InvalidArgumentException('non-nullable filter_extra cannot be null'); + } + $this->container['filter_extra'] = $filter_extra; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Currency.php b/lib/Model/Currency.php new file mode 100644 index 0000000..a7f83ef --- /dev/null +++ b/lib/Model/Currency.php @@ -0,0 +1,180 @@ + + */ +class Discount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Discount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\Cone\Billingo\Model\DiscountType', + 'value' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'value' => 'float' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \Cone\Billingo\Model\DiscountType|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Cone\Billingo\Model\DiscountType|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets value + * + * @return float|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param float|null $value value + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DiscountType.php b/lib/Model/DiscountType.php new file mode 100644 index 0000000..e2aba7d --- /dev/null +++ b/lib/Model/DiscountType.php @@ -0,0 +1,60 @@ + + */ +class Document implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Document'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'invoice_number' => 'string', + 'type' => '\Cone\Billingo\Model\DocumentType', + 'cancelled' => 'bool', + 'block_id' => 'int', + 'payment_status' => '\Cone\Billingo\Model\PaymentStatus', + 'payment_method' => '\Cone\Billingo\Model\PaymentMethod', + 'gross_total' => 'float', + 'currency' => '\Cone\Billingo\Model\Currency', + 'conversion_rate' => 'float', + 'invoice_date' => '\DateTime', + 'fulfillment_date' => '\DateTime', + 'due_date' => '\DateTime', + 'paid_date' => '\DateTime', + 'organization' => '\Cone\Billingo\Model\DocumentOrganization', + 'partner' => '\Cone\Billingo\Model\Partner', + 'document_partner' => '\Cone\Billingo\Model\DocumentPartner', + 'electronic' => 'bool', + 'comment' => 'string', + 'tags' => 'string[]', + 'notification_status' => '\Cone\Billingo\Model\DocumentNotificationStatus', + 'language' => '\Cone\Billingo\Model\DocumentLanguage', + 'items' => '\Cone\Billingo\Model\DocumentItem[]', + 'summary' => '\Cone\Billingo\Model\DocumentSummary', + 'settings' => '\Cone\Billingo\Model\DocumentSettings', + 'online_szamla_status' => '\Cone\Billingo\Model\OnlineSzamlaStatusEnum', + 'related_documents' => '\Cone\Billingo\Model\DocumentAncestor[]', + 'discount' => '\Cone\Billingo\Model\Discount', + 'correction_type' => '\Cone\Billingo\Model\CorrectionType', + 'recurring_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'invoice_number' => null, + 'type' => null, + 'cancelled' => null, + 'block_id' => null, + 'payment_status' => null, + 'payment_method' => null, + 'gross_total' => 'float', + 'currency' => null, + 'conversion_rate' => 'float', + 'invoice_date' => 'date', + 'fulfillment_date' => 'date', + 'due_date' => 'date', + 'paid_date' => 'date', + 'organization' => null, + 'partner' => null, + 'document_partner' => null, + 'electronic' => null, + 'comment' => null, + 'tags' => null, + 'notification_status' => null, + 'language' => null, + 'items' => null, + 'summary' => null, + 'settings' => null, + 'online_szamla_status' => null, + 'related_documents' => null, + 'discount' => null, + 'correction_type' => null, + 'recurring_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'invoice_number' => false, + 'type' => false, + 'cancelled' => false, + 'block_id' => false, + 'payment_status' => false, + 'payment_method' => false, + 'gross_total' => false, + 'currency' => false, + 'conversion_rate' => false, + 'invoice_date' => false, + 'fulfillment_date' => false, + 'due_date' => false, + 'paid_date' => false, + 'organization' => false, + 'partner' => false, + 'document_partner' => false, + 'electronic' => false, + 'comment' => false, + 'tags' => false, + 'notification_status' => false, + 'language' => false, + 'items' => false, + 'summary' => false, + 'settings' => false, + 'online_szamla_status' => false, + 'related_documents' => false, + 'discount' => false, + 'correction_type' => false, + 'recurring_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'invoice_number' => 'invoice_number', + 'type' => 'type', + 'cancelled' => 'cancelled', + 'block_id' => 'block_id', + 'payment_status' => 'payment_status', + 'payment_method' => 'payment_method', + 'gross_total' => 'gross_total', + 'currency' => 'currency', + 'conversion_rate' => 'conversion_rate', + 'invoice_date' => 'invoice_date', + 'fulfillment_date' => 'fulfillment_date', + 'due_date' => 'due_date', + 'paid_date' => 'paid_date', + 'organization' => 'organization', + 'partner' => 'partner', + 'document_partner' => 'document_partner', + 'electronic' => 'electronic', + 'comment' => 'comment', + 'tags' => 'tags', + 'notification_status' => 'notification_status', + 'language' => 'language', + 'items' => 'items', + 'summary' => 'summary', + 'settings' => 'settings', + 'online_szamla_status' => 'online_szamla_status', + 'related_documents' => 'related_documents', + 'discount' => 'discount', + 'correction_type' => 'correction_type', + 'recurring_id' => 'recurring_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'invoice_number' => 'setInvoiceNumber', + 'type' => 'setType', + 'cancelled' => 'setCancelled', + 'block_id' => 'setBlockId', + 'payment_status' => 'setPaymentStatus', + 'payment_method' => 'setPaymentMethod', + 'gross_total' => 'setGrossTotal', + 'currency' => 'setCurrency', + 'conversion_rate' => 'setConversionRate', + 'invoice_date' => 'setInvoiceDate', + 'fulfillment_date' => 'setFulfillmentDate', + 'due_date' => 'setDueDate', + 'paid_date' => 'setPaidDate', + 'organization' => 'setOrganization', + 'partner' => 'setPartner', + 'document_partner' => 'setDocumentPartner', + 'electronic' => 'setElectronic', + 'comment' => 'setComment', + 'tags' => 'setTags', + 'notification_status' => 'setNotificationStatus', + 'language' => 'setLanguage', + 'items' => 'setItems', + 'summary' => 'setSummary', + 'settings' => 'setSettings', + 'online_szamla_status' => 'setOnlineSzamlaStatus', + 'related_documents' => 'setRelatedDocuments', + 'discount' => 'setDiscount', + 'correction_type' => 'setCorrectionType', + 'recurring_id' => 'setRecurringId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'invoice_number' => 'getInvoiceNumber', + 'type' => 'getType', + 'cancelled' => 'getCancelled', + 'block_id' => 'getBlockId', + 'payment_status' => 'getPaymentStatus', + 'payment_method' => 'getPaymentMethod', + 'gross_total' => 'getGrossTotal', + 'currency' => 'getCurrency', + 'conversion_rate' => 'getConversionRate', + 'invoice_date' => 'getInvoiceDate', + 'fulfillment_date' => 'getFulfillmentDate', + 'due_date' => 'getDueDate', + 'paid_date' => 'getPaidDate', + 'organization' => 'getOrganization', + 'partner' => 'getPartner', + 'document_partner' => 'getDocumentPartner', + 'electronic' => 'getElectronic', + 'comment' => 'getComment', + 'tags' => 'getTags', + 'notification_status' => 'getNotificationStatus', + 'language' => 'getLanguage', + 'items' => 'getItems', + 'summary' => 'getSummary', + 'settings' => 'getSettings', + 'online_szamla_status' => 'getOnlineSzamlaStatus', + 'related_documents' => 'getRelatedDocuments', + 'discount' => 'getDiscount', + 'correction_type' => 'getCorrectionType', + 'recurring_id' => 'getRecurringId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('invoice_number', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('cancelled', $data ?? [], null); + $this->setIfExists('block_id', $data ?? [], null); + $this->setIfExists('payment_status', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('gross_total', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('conversion_rate', $data ?? [], null); + $this->setIfExists('invoice_date', $data ?? [], null); + $this->setIfExists('fulfillment_date', $data ?? [], null); + $this->setIfExists('due_date', $data ?? [], null); + $this->setIfExists('paid_date', $data ?? [], null); + $this->setIfExists('organization', $data ?? [], null); + $this->setIfExists('partner', $data ?? [], null); + $this->setIfExists('document_partner', $data ?? [], null); + $this->setIfExists('electronic', $data ?? [], null); + $this->setIfExists('comment', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('notification_status', $data ?? [], null); + $this->setIfExists('language', $data ?? [], null); + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('summary', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); + $this->setIfExists('online_szamla_status', $data ?? [], null); + $this->setIfExists('related_documents', $data ?? [], null); + $this->setIfExists('discount', $data ?? [], null); + $this->setIfExists('correction_type', $data ?? [], null); + $this->setIfExists('recurring_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id The document's unique identifier. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets invoice_number + * + * @return string|null + */ + public function getInvoiceNumber() + { + return $this->container['invoice_number']; + } + + /** + * Sets invoice_number + * + * @param string|null $invoice_number The document's invoice number. + * + * @return self + */ + public function setInvoiceNumber($invoice_number) + { + if (is_null($invoice_number)) { + throw new \InvalidArgumentException('non-nullable invoice_number cannot be null'); + } + $this->container['invoice_number'] = $invoice_number; + + return $this; + } + + /** + * Gets type + * + * @return \Cone\Billingo\Model\DocumentType|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Cone\Billingo\Model\DocumentType|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets cancelled + * + * @return bool|null + */ + public function getCancelled() + { + return $this->container['cancelled']; + } + + /** + * Sets cancelled + * + * @param bool|null $cancelled cancelled + * + * @return self + */ + public function setCancelled($cancelled) + { + if (is_null($cancelled)) { + throw new \InvalidArgumentException('non-nullable cancelled cannot be null'); + } + $this->container['cancelled'] = $cancelled; + + return $this; + } + + /** + * Gets block_id + * + * @return int|null + */ + public function getBlockId() + { + return $this->container['block_id']; + } + + /** + * Sets block_id + * + * @param int|null $block_id DocumentBlock's identifier. + * + * @return self + */ + public function setBlockId($block_id) + { + if (is_null($block_id)) { + throw new \InvalidArgumentException('non-nullable block_id cannot be null'); + } + $this->container['block_id'] = $block_id; + + return $this; + } + + /** + * Gets payment_status + * + * @return \Cone\Billingo\Model\PaymentStatus|null + */ + public function getPaymentStatus() + { + return $this->container['payment_status']; + } + + /** + * Sets payment_status + * + * @param \Cone\Billingo\Model\PaymentStatus|null $payment_status payment_status + * + * @return self + */ + public function setPaymentStatus($payment_status) + { + if (is_null($payment_status)) { + throw new \InvalidArgumentException('non-nullable payment_status cannot be null'); + } + $this->container['payment_status'] = $payment_status; + + return $this; + } + + /** + * Gets payment_method + * + * @return \Cone\Billingo\Model\PaymentMethod|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Cone\Billingo\Model\PaymentMethod|null $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets gross_total + * + * @return float|null + */ + public function getGrossTotal() + { + return $this->container['gross_total']; + } + + /** + * Sets gross_total + * + * @param float|null $gross_total The document's gross total price. + * + * @return self + */ + public function setGrossTotal($gross_total) + { + if (is_null($gross_total)) { + throw new \InvalidArgumentException('non-nullable gross_total cannot be null'); + } + $this->container['gross_total'] = $gross_total; + + return $this; + } + + /** + * Gets currency + * + * @return \Cone\Billingo\Model\Currency|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param \Cone\Billingo\Model\Currency|null $currency currency + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets conversion_rate + * + * @return float|null + */ + public function getConversionRate() + { + return $this->container['conversion_rate']; + } + + /** + * Sets conversion_rate + * + * @param float|null $conversion_rate conversion_rate + * + * @return self + */ + public function setConversionRate($conversion_rate) + { + if (is_null($conversion_rate)) { + throw new \InvalidArgumentException('non-nullable conversion_rate cannot be null'); + } + $this->container['conversion_rate'] = $conversion_rate; + + return $this; + } + + /** + * Gets invoice_date + * + * @return \DateTime|null + */ + public function getInvoiceDate() + { + return $this->container['invoice_date']; + } + + /** + * Sets invoice_date + * + * @param \DateTime|null $invoice_date invoice_date + * + * @return self + */ + public function setInvoiceDate($invoice_date) + { + if (is_null($invoice_date)) { + throw new \InvalidArgumentException('non-nullable invoice_date cannot be null'); + } + $this->container['invoice_date'] = $invoice_date; + + return $this; + } + + /** + * Gets fulfillment_date + * + * @return \DateTime|null + */ + public function getFulfillmentDate() + { + return $this->container['fulfillment_date']; + } + + /** + * Sets fulfillment_date + * + * @param \DateTime|null $fulfillment_date fulfillment_date + * + * @return self + */ + public function setFulfillmentDate($fulfillment_date) + { + if (is_null($fulfillment_date)) { + throw new \InvalidArgumentException('non-nullable fulfillment_date cannot be null'); + } + $this->container['fulfillment_date'] = $fulfillment_date; + + return $this; + } + + /** + * Gets due_date + * + * @return \DateTime|null + */ + public function getDueDate() + { + return $this->container['due_date']; + } + + /** + * Sets due_date + * + * @param \DateTime|null $due_date due_date + * + * @return self + */ + public function setDueDate($due_date) + { + if (is_null($due_date)) { + throw new \InvalidArgumentException('non-nullable due_date cannot be null'); + } + $this->container['due_date'] = $due_date; + + return $this; + } + + /** + * Gets paid_date + * + * @return \DateTime|null + */ + public function getPaidDate() + { + return $this->container['paid_date']; + } + + /** + * Sets paid_date + * + * @param \DateTime|null $paid_date If payment_status equals 'paid' or 'partially_paid', it will show the paid date otherwise the current date. + * + * @return self + */ + public function setPaidDate($paid_date) + { + if (is_null($paid_date)) { + throw new \InvalidArgumentException('non-nullable paid_date cannot be null'); + } + $this->container['paid_date'] = $paid_date; + + return $this; + } + + /** + * Gets organization + * + * @return \Cone\Billingo\Model\DocumentOrganization|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \Cone\Billingo\Model\DocumentOrganization|null $organization organization + * + * @return self + */ + public function setOrganization($organization) + { + if (is_null($organization)) { + throw new \InvalidArgumentException('non-nullable organization cannot be null'); + } + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets partner + * + * @return \Cone\Billingo\Model\Partner|null + */ + public function getPartner() + { + return $this->container['partner']; + } + + /** + * Sets partner + * + * @param \Cone\Billingo\Model\Partner|null $partner partner + * + * @return self + */ + public function setPartner($partner) + { + if (is_null($partner)) { + throw new \InvalidArgumentException('non-nullable partner cannot be null'); + } + $this->container['partner'] = $partner; + + return $this; + } + + /** + * Gets document_partner + * + * @return \Cone\Billingo\Model\DocumentPartner|null + */ + public function getDocumentPartner() + { + return $this->container['document_partner']; + } + + /** + * Sets document_partner + * + * @param \Cone\Billingo\Model\DocumentPartner|null $document_partner document_partner + * + * @return self + */ + public function setDocumentPartner($document_partner) + { + if (is_null($document_partner)) { + throw new \InvalidArgumentException('non-nullable document_partner cannot be null'); + } + $this->container['document_partner'] = $document_partner; + + return $this; + } + + /** + * Gets electronic + * + * @return bool|null + */ + public function getElectronic() + { + return $this->container['electronic']; + } + + /** + * Sets electronic + * + * @param bool|null $electronic electronic + * + * @return self + */ + public function setElectronic($electronic) + { + if (is_null($electronic)) { + throw new \InvalidArgumentException('non-nullable electronic cannot be null'); + } + $this->container['electronic'] = $electronic; + + return $this; + } + + /** + * Gets comment + * + * @return string|null + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string|null $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + throw new \InvalidArgumentException('non-nullable comment cannot be null'); + } + $this->container['comment'] = $comment; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags tags + * + * @return self + */ + public function setTags($tags) + { + if (is_null($tags)) { + throw new \InvalidArgumentException('non-nullable tags cannot be null'); + } + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets notification_status + * + * @return \Cone\Billingo\Model\DocumentNotificationStatus|null + */ + public function getNotificationStatus() + { + return $this->container['notification_status']; + } + + /** + * Sets notification_status + * + * @param \Cone\Billingo\Model\DocumentNotificationStatus|null $notification_status notification_status + * + * @return self + */ + public function setNotificationStatus($notification_status) + { + if (is_null($notification_status)) { + throw new \InvalidArgumentException('non-nullable notification_status cannot be null'); + } + $this->container['notification_status'] = $notification_status; + + return $this; + } + + /** + * Gets language + * + * @return \Cone\Billingo\Model\DocumentLanguage|null + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param \Cone\Billingo\Model\DocumentLanguage|null $language language + * + * @return self + */ + public function setLanguage($language) + { + if (is_null($language)) { + throw new \InvalidArgumentException('non-nullable language cannot be null'); + } + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets items + * + * @return \Cone\Billingo\Model\DocumentItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Cone\Billingo\Model\DocumentItem[]|null $items items + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets summary + * + * @return \Cone\Billingo\Model\DocumentSummary|null + */ + public function getSummary() + { + return $this->container['summary']; + } + + /** + * Sets summary + * + * @param \Cone\Billingo\Model\DocumentSummary|null $summary summary + * + * @return self + */ + public function setSummary($summary) + { + if (is_null($summary)) { + throw new \InvalidArgumentException('non-nullable summary cannot be null'); + } + $this->container['summary'] = $summary; + + return $this; + } + + /** + * Gets settings + * + * @return \Cone\Billingo\Model\DocumentSettings|null + */ + public function getSettings() + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \Cone\Billingo\Model\DocumentSettings|null $settings settings + * + * @return self + */ + public function setSettings($settings) + { + if (is_null($settings)) { + throw new \InvalidArgumentException('non-nullable settings cannot be null'); + } + $this->container['settings'] = $settings; + + return $this; + } + + /** + * Gets online_szamla_status + * + * @return \Cone\Billingo\Model\OnlineSzamlaStatusEnum|null + */ + public function getOnlineSzamlaStatus() + { + return $this->container['online_szamla_status']; + } + + /** + * Sets online_szamla_status + * + * @param \Cone\Billingo\Model\OnlineSzamlaStatusEnum|null $online_szamla_status online_szamla_status + * + * @return self + */ + public function setOnlineSzamlaStatus($online_szamla_status) + { + if (is_null($online_szamla_status)) { + throw new \InvalidArgumentException('non-nullable online_szamla_status cannot be null'); + } + $this->container['online_szamla_status'] = $online_szamla_status; + + return $this; + } + + /** + * Gets related_documents + * + * @return \Cone\Billingo\Model\DocumentAncestor[]|null + */ + public function getRelatedDocuments() + { + return $this->container['related_documents']; + } + + /** + * Sets related_documents + * + * @param \Cone\Billingo\Model\DocumentAncestor[]|null $related_documents related_documents + * + * @return self + */ + public function setRelatedDocuments($related_documents) + { + if (is_null($related_documents)) { + throw new \InvalidArgumentException('non-nullable related_documents cannot be null'); + } + $this->container['related_documents'] = $related_documents; + + return $this; + } + + /** + * Gets discount + * + * @return \Cone\Billingo\Model\Discount|null + */ + public function getDiscount() + { + return $this->container['discount']; + } + + /** + * Sets discount + * + * @param \Cone\Billingo\Model\Discount|null $discount discount + * + * @return self + */ + public function setDiscount($discount) + { + if (is_null($discount)) { + throw new \InvalidArgumentException('non-nullable discount cannot be null'); + } + $this->container['discount'] = $discount; + + return $this; + } + + /** + * Gets correction_type + * + * @return \Cone\Billingo\Model\CorrectionType|null + */ + public function getCorrectionType() + { + return $this->container['correction_type']; + } + + /** + * Sets correction_type + * + * @param \Cone\Billingo\Model\CorrectionType|null $correction_type correction_type + * + * @return self + */ + public function setCorrectionType($correction_type) + { + if (is_null($correction_type)) { + throw new \InvalidArgumentException('non-nullable correction_type cannot be null'); + } + $this->container['correction_type'] = $correction_type; + + return $this; + } + + /** + * Gets recurring_id + * + * @return int|null + */ + public function getRecurringId() + { + return $this->container['recurring_id']; + } + + /** + * Sets recurring_id + * + * @param int|null $recurring_id recurring_id + * + * @return self + */ + public function setRecurringId($recurring_id) + { + if (is_null($recurring_id)) { + throw new \InvalidArgumentException('non-nullable recurring_id cannot be null'); + } + $this->container['recurring_id'] = $recurring_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentAncestor.php b/lib/Model/DocumentAncestor.php new file mode 100644 index 0000000..b46211d --- /dev/null +++ b/lib/Model/DocumentAncestor.php @@ -0,0 +1,445 @@ + + */ +class DocumentAncestor implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentAncestor'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'invoice_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'invoice_number' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'invoice_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'invoice_number' => 'invoice_number' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'invoice_number' => 'setInvoiceNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'invoice_number' => 'getInvoiceNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('invoice_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id Unique identifier of the related document. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets invoice_number + * + * @return string|null + */ + public function getInvoiceNumber() + { + return $this->container['invoice_number']; + } + + /** + * Sets invoice_number + * + * @param string|null $invoice_number Invoice number of the related document. + * + * @return self + */ + public function setInvoiceNumber($invoice_number) + { + if (is_null($invoice_number)) { + throw new \InvalidArgumentException('non-nullable invoice_number cannot be null'); + } + $this->container['invoice_number'] = $invoice_number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentBankAccount.php b/lib/Model/DocumentBankAccount.php new file mode 100644 index 0000000..c77752e --- /dev/null +++ b/lib/Model/DocumentBankAccount.php @@ -0,0 +1,559 @@ + + */ +class DocumentBankAccount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentBankAccount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'account_number' => 'string', + 'account_number_iban' => 'string', + 'swift' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'account_number' => null, + 'account_number_iban' => null, + 'swift' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => true, + 'name' => false, + 'account_number' => false, + 'account_number_iban' => false, + 'swift' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'account_number' => 'account_number', + 'account_number_iban' => 'account_number_iban', + 'swift' => 'swift' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'account_number' => 'setAccountNumber', + 'account_number_iban' => 'setAccountNumberIban', + 'swift' => 'setSwift' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'account_number' => 'getAccountNumber', + 'account_number_iban' => 'getAccountNumberIban', + 'swift' => 'getSwift' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('account_number_iban', $data ?? [], null); + $this->setIfExists('swift', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['account_number'] === null) { + $invalidProperties[] = "'account_number' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + array_push($this->openAPINullablesSetToNull, 'id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets account_number + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string $account_number account_number + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets account_number_iban + * + * @return string|null + */ + public function getAccountNumberIban() + { + return $this->container['account_number_iban']; + } + + /** + * Sets account_number_iban + * + * @param string|null $account_number_iban account_number_iban + * + * @return self + */ + public function setAccountNumberIban($account_number_iban) + { + if (is_null($account_number_iban)) { + throw new \InvalidArgumentException('non-nullable account_number_iban cannot be null'); + } + $this->container['account_number_iban'] = $account_number_iban; + + return $this; + } + + /** + * Gets swift + * + * @return string|null + */ + public function getSwift() + { + return $this->container['swift']; + } + + /** + * Sets swift + * + * @param string|null $swift swift + * + * @return self + */ + public function setSwift($swift) + { + if (is_null($swift)) { + throw new \InvalidArgumentException('non-nullable swift cannot be null'); + } + $this->container['swift'] = $swift; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentBlock.php b/lib/Model/DocumentBlock.php new file mode 100644 index 0000000..e9bbb90 --- /dev/null +++ b/lib/Model/DocumentBlock.php @@ -0,0 +1,580 @@ + + */ +class DocumentBlock implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentBlock'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'prefix' => 'string', + 'custom_field1' => 'string', + 'custom_field2' => 'string', + 'type' => '\Cone\Billingo\Model\DocumentBlockType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'prefix' => null, + 'custom_field1' => null, + 'custom_field2' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'prefix' => false, + 'custom_field1' => false, + 'custom_field2' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'prefix' => 'prefix', + 'custom_field1' => 'custom_field1', + 'custom_field2' => 'custom_field2', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'prefix' => 'setPrefix', + 'custom_field1' => 'setCustomField1', + 'custom_field2' => 'setCustomField2', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'prefix' => 'getPrefix', + 'custom_field1' => 'getCustomField1', + 'custom_field2' => 'getCustomField2', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('prefix', $data ?? [], null); + $this->setIfExists('custom_field1', $data ?? [], null); + $this->setIfExists('custom_field2', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets prefix + * + * @return string|null + */ + public function getPrefix() + { + return $this->container['prefix']; + } + + /** + * Sets prefix + * + * @param string|null $prefix prefix + * + * @return self + */ + public function setPrefix($prefix) + { + if (is_null($prefix)) { + throw new \InvalidArgumentException('non-nullable prefix cannot be null'); + } + $this->container['prefix'] = $prefix; + + return $this; + } + + /** + * Gets custom_field1 + * + * @return string|null + */ + public function getCustomField1() + { + return $this->container['custom_field1']; + } + + /** + * Sets custom_field1 + * + * @param string|null $custom_field1 custom_field1 + * + * @return self + */ + public function setCustomField1($custom_field1) + { + if (is_null($custom_field1)) { + throw new \InvalidArgumentException('non-nullable custom_field1 cannot be null'); + } + $this->container['custom_field1'] = $custom_field1; + + return $this; + } + + /** + * Gets custom_field2 + * + * @return string|null + */ + public function getCustomField2() + { + return $this->container['custom_field2']; + } + + /** + * Sets custom_field2 + * + * @param string|null $custom_field2 custom_field2 + * + * @return self + */ + public function setCustomField2($custom_field2) + { + if (is_null($custom_field2)) { + throw new \InvalidArgumentException('non-nullable custom_field2 cannot be null'); + } + $this->container['custom_field2'] = $custom_field2; + + return $this; + } + + /** + * Gets type + * + * @return \Cone\Billingo\Model\DocumentBlockType|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Cone\Billingo\Model\DocumentBlockType|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentBlockList.php b/lib/Model/DocumentBlockList.php new file mode 100644 index 0000000..22c5209 --- /dev/null +++ b/lib/Model/DocumentBlockList.php @@ -0,0 +1,615 @@ + + */ +class DocumentBlockList implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentBlockList'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Cone\Billingo\Model\DocumentBlock[]', + 'total' => 'int', + 'per_page' => 'int', + 'current_page' => 'int', + 'last_page' => 'int', + 'prev_page_url' => 'string', + 'next_page_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'total' => null, + 'per_page' => null, + 'current_page' => null, + 'last_page' => null, + 'prev_page_url' => null, + 'next_page_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false, + 'total' => false, + 'per_page' => false, + 'current_page' => false, + 'last_page' => false, + 'prev_page_url' => false, + 'next_page_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'total' => 'total', + 'per_page' => 'per_page', + 'current_page' => 'current_page', + 'last_page' => 'last_page', + 'prev_page_url' => 'prev_page_url', + 'next_page_url' => 'next_page_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'total' => 'setTotal', + 'per_page' => 'setPerPage', + 'current_page' => 'setCurrentPage', + 'last_page' => 'setLastPage', + 'prev_page_url' => 'setPrevPageUrl', + 'next_page_url' => 'setNextPageUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'total' => 'getTotal', + 'per_page' => 'getPerPage', + 'current_page' => 'getCurrentPage', + 'last_page' => 'getLastPage', + 'prev_page_url' => 'getPrevPageUrl', + 'next_page_url' => 'getNextPageUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('per_page', $data ?? [], null); + $this->setIfExists('current_page', $data ?? [], null); + $this->setIfExists('last_page', $data ?? [], null); + $this->setIfExists('prev_page_url', $data ?? [], null); + $this->setIfExists('next_page_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Cone\Billingo\Model\DocumentBlock[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Cone\Billingo\Model\DocumentBlock[]|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets total + * + * @return int|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int|null $total total + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets per_page + * + * @return int|null + */ + public function getPerPage() + { + return $this->container['per_page']; + } + + /** + * Sets per_page + * + * @param int|null $per_page per_page + * + * @return self + */ + public function setPerPage($per_page) + { + if (is_null($per_page)) { + throw new \InvalidArgumentException('non-nullable per_page cannot be null'); + } + $this->container['per_page'] = $per_page; + + return $this; + } + + /** + * Gets current_page + * + * @return int|null + */ + public function getCurrentPage() + { + return $this->container['current_page']; + } + + /** + * Sets current_page + * + * @param int|null $current_page current_page + * + * @return self + */ + public function setCurrentPage($current_page) + { + if (is_null($current_page)) { + throw new \InvalidArgumentException('non-nullable current_page cannot be null'); + } + $this->container['current_page'] = $current_page; + + return $this; + } + + /** + * Gets last_page + * + * @return int|null + */ + public function getLastPage() + { + return $this->container['last_page']; + } + + /** + * Sets last_page + * + * @param int|null $last_page last_page + * + * @return self + */ + public function setLastPage($last_page) + { + if (is_null($last_page)) { + throw new \InvalidArgumentException('non-nullable last_page cannot be null'); + } + $this->container['last_page'] = $last_page; + + return $this; + } + + /** + * Gets prev_page_url + * + * @return string|null + */ + public function getPrevPageUrl() + { + return $this->container['prev_page_url']; + } + + /** + * Sets prev_page_url + * + * @param string|null $prev_page_url prev_page_url + * + * @return self + */ + public function setPrevPageUrl($prev_page_url) + { + if (is_null($prev_page_url)) { + throw new \InvalidArgumentException('non-nullable prev_page_url cannot be null'); + } + $this->container['prev_page_url'] = $prev_page_url; + + return $this; + } + + /** + * Gets next_page_url + * + * @return string|null + */ + public function getNextPageUrl() + { + return $this->container['next_page_url']; + } + + /** + * Sets next_page_url + * + * @param string|null $next_page_url next_page_url + * + * @return self + */ + public function setNextPageUrl($next_page_url) + { + if (is_null($next_page_url)) { + throw new \InvalidArgumentException('non-nullable next_page_url cannot be null'); + } + $this->container['next_page_url'] = $next_page_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentBlockType.php b/lib/Model/DocumentBlockType.php new file mode 100644 index 0000000..488e280 --- /dev/null +++ b/lib/Model/DocumentBlockType.php @@ -0,0 +1,78 @@ + + */ +class DocumentCancellation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentCancellation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cancellation_reason' => 'string', + 'cancellation_recipients' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cancellation_reason' => null, + 'cancellation_recipients' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cancellation_reason' => false, + 'cancellation_recipients' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cancellation_reason' => 'cancellation_reason', + 'cancellation_recipients' => 'cancellation_recipients' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cancellation_reason' => 'setCancellationReason', + 'cancellation_recipients' => 'setCancellationRecipients' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cancellation_reason' => 'getCancellationReason', + 'cancellation_recipients' => 'getCancellationRecipients' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('cancellation_reason', $data ?? [], null); + $this->setIfExists('cancellation_recipients', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets cancellation_reason + * + * @return string|null + */ + public function getCancellationReason() + { + return $this->container['cancellation_reason']; + } + + /** + * Sets cancellation_reason + * + * @param string|null $cancellation_reason cancellation_reason + * + * @return self + */ + public function setCancellationReason($cancellation_reason) + { + if (is_null($cancellation_reason)) { + throw new \InvalidArgumentException('non-nullable cancellation_reason cannot be null'); + } + $this->container['cancellation_reason'] = $cancellation_reason; + + return $this; + } + + /** + * Gets cancellation_recipients + * + * @return string|null + */ + public function getCancellationRecipients() + { + return $this->container['cancellation_recipients']; + } + + /** + * Sets cancellation_recipients + * + * @param string|null $cancellation_recipients cancellation_recipients + * + * @return self + */ + public function setCancellationRecipients($cancellation_recipients) + { + if (is_null($cancellation_recipients)) { + throw new \InvalidArgumentException('non-nullable cancellation_recipients cannot be null'); + } + $this->container['cancellation_recipients'] = $cancellation_recipients; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentExportFilterExtra.php b/lib/Model/DocumentExportFilterExtra.php new file mode 100644 index 0000000..d949374 --- /dev/null +++ b/lib/Model/DocumentExportFilterExtra.php @@ -0,0 +1,682 @@ + + */ +class DocumentExportFilterExtra implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentExportFilterExtra'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'tensoft_vkod' => 'string', + 'ledger_number' => '\Cone\Billingo\Model\LedgerNumberInformation', + 'forintsoft_konyvelesi_naplo_szam' => 'string', + 'positive_ledger_number' => 'string', + 'negative_ledger_number' => 'string', + 'rlb_kata' => 'bool', + 'rlb_note' => 'string', + 'novitax_naplokod' => 'string', + 'use_gross_values' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'tensoft_vkod' => null, + 'ledger_number' => null, + 'forintsoft_konyvelesi_naplo_szam' => null, + 'positive_ledger_number' => null, + 'negative_ledger_number' => null, + 'rlb_kata' => null, + 'rlb_note' => null, + 'novitax_naplokod' => null, + 'use_gross_values' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tensoft_vkod' => false, + 'ledger_number' => false, + 'forintsoft_konyvelesi_naplo_szam' => false, + 'positive_ledger_number' => false, + 'negative_ledger_number' => false, + 'rlb_kata' => false, + 'rlb_note' => false, + 'novitax_naplokod' => false, + 'use_gross_values' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tensoft_vkod' => 'tensoft_vkod', + 'ledger_number' => 'ledger_number', + 'forintsoft_konyvelesi_naplo_szam' => 'forintsoft_konyvelesi_naplo_szam', + 'positive_ledger_number' => 'positive_ledger_number', + 'negative_ledger_number' => 'negative_ledger_number', + 'rlb_kata' => 'rlb_kata', + 'rlb_note' => 'rlb_note', + 'novitax_naplokod' => 'novitax_naplokod', + 'use_gross_values' => 'use_gross_values' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tensoft_vkod' => 'setTensoftVkod', + 'ledger_number' => 'setLedgerNumber', + 'forintsoft_konyvelesi_naplo_szam' => 'setForintsoftKonyvelesiNaploSzam', + 'positive_ledger_number' => 'setPositiveLedgerNumber', + 'negative_ledger_number' => 'setNegativeLedgerNumber', + 'rlb_kata' => 'setRlbKata', + 'rlb_note' => 'setRlbNote', + 'novitax_naplokod' => 'setNovitaxNaplokod', + 'use_gross_values' => 'setUseGrossValues' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tensoft_vkod' => 'getTensoftVkod', + 'ledger_number' => 'getLedgerNumber', + 'forintsoft_konyvelesi_naplo_szam' => 'getForintsoftKonyvelesiNaploSzam', + 'positive_ledger_number' => 'getPositiveLedgerNumber', + 'negative_ledger_number' => 'getNegativeLedgerNumber', + 'rlb_kata' => 'getRlbKata', + 'rlb_note' => 'getRlbNote', + 'novitax_naplokod' => 'getNovitaxNaplokod', + 'use_gross_values' => 'getUseGrossValues' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('tensoft_vkod', $data ?? [], null); + $this->setIfExists('ledger_number', $data ?? [], null); + $this->setIfExists('forintsoft_konyvelesi_naplo_szam', $data ?? [], null); + $this->setIfExists('positive_ledger_number', $data ?? [], null); + $this->setIfExists('negative_ledger_number', $data ?? [], null); + $this->setIfExists('rlb_kata', $data ?? [], null); + $this->setIfExists('rlb_note', $data ?? [], null); + $this->setIfExists('novitax_naplokod', $data ?? [], null); + $this->setIfExists('use_gross_values', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets tensoft_vkod + * + * @return string|null + */ + public function getTensoftVkod() + { + return $this->container['tensoft_vkod']; + } + + /** + * Sets tensoft_vkod + * + * @param string|null $tensoft_vkod tensoft_vkod + * + * @return self + */ + public function setTensoftVkod($tensoft_vkod) + { + if (is_null($tensoft_vkod)) { + throw new \InvalidArgumentException('non-nullable tensoft_vkod cannot be null'); + } + $this->container['tensoft_vkod'] = $tensoft_vkod; + + return $this; + } + + /** + * Gets ledger_number + * + * @return \Cone\Billingo\Model\LedgerNumberInformation|null + */ + public function getLedgerNumber() + { + return $this->container['ledger_number']; + } + + /** + * Sets ledger_number + * + * @param \Cone\Billingo\Model\LedgerNumberInformation|null $ledger_number ledger_number + * + * @return self + */ + public function setLedgerNumber($ledger_number) + { + if (is_null($ledger_number)) { + throw new \InvalidArgumentException('non-nullable ledger_number cannot be null'); + } + $this->container['ledger_number'] = $ledger_number; + + return $this; + } + + /** + * Gets forintsoft_konyvelesi_naplo_szam + * + * @return string|null + */ + public function getForintsoftKonyvelesiNaploSzam() + { + return $this->container['forintsoft_konyvelesi_naplo_szam']; + } + + /** + * Sets forintsoft_konyvelesi_naplo_szam + * + * @param string|null $forintsoft_konyvelesi_naplo_szam forintsoft_konyvelesi_naplo_szam + * + * @return self + */ + public function setForintsoftKonyvelesiNaploSzam($forintsoft_konyvelesi_naplo_szam) + { + if (is_null($forintsoft_konyvelesi_naplo_szam)) { + throw new \InvalidArgumentException('non-nullable forintsoft_konyvelesi_naplo_szam cannot be null'); + } + $this->container['forintsoft_konyvelesi_naplo_szam'] = $forintsoft_konyvelesi_naplo_szam; + + return $this; + } + + /** + * Gets positive_ledger_number + * + * @return string|null + */ + public function getPositiveLedgerNumber() + { + return $this->container['positive_ledger_number']; + } + + /** + * Sets positive_ledger_number + * + * @param string|null $positive_ledger_number positive_ledger_number + * + * @return self + */ + public function setPositiveLedgerNumber($positive_ledger_number) + { + if (is_null($positive_ledger_number)) { + throw new \InvalidArgumentException('non-nullable positive_ledger_number cannot be null'); + } + $this->container['positive_ledger_number'] = $positive_ledger_number; + + return $this; + } + + /** + * Gets negative_ledger_number + * + * @return string|null + */ + public function getNegativeLedgerNumber() + { + return $this->container['negative_ledger_number']; + } + + /** + * Sets negative_ledger_number + * + * @param string|null $negative_ledger_number negative_ledger_number + * + * @return self + */ + public function setNegativeLedgerNumber($negative_ledger_number) + { + if (is_null($negative_ledger_number)) { + throw new \InvalidArgumentException('non-nullable negative_ledger_number cannot be null'); + } + $this->container['negative_ledger_number'] = $negative_ledger_number; + + return $this; + } + + /** + * Gets rlb_kata + * + * @return bool|null + */ + public function getRlbKata() + { + return $this->container['rlb_kata']; + } + + /** + * Sets rlb_kata + * + * @param bool|null $rlb_kata rlb_kata + * + * @return self + */ + public function setRlbKata($rlb_kata) + { + if (is_null($rlb_kata)) { + throw new \InvalidArgumentException('non-nullable rlb_kata cannot be null'); + } + $this->container['rlb_kata'] = $rlb_kata; + + return $this; + } + + /** + * Gets rlb_note + * + * @return string|null + */ + public function getRlbNote() + { + return $this->container['rlb_note']; + } + + /** + * Sets rlb_note + * + * @param string|null $rlb_note rlb_note + * + * @return self + */ + public function setRlbNote($rlb_note) + { + if (is_null($rlb_note)) { + throw new \InvalidArgumentException('non-nullable rlb_note cannot be null'); + } + $this->container['rlb_note'] = $rlb_note; + + return $this; + } + + /** + * Gets novitax_naplokod + * + * @return string|null + */ + public function getNovitaxNaplokod() + { + return $this->container['novitax_naplokod']; + } + + /** + * Sets novitax_naplokod + * + * @param string|null $novitax_naplokod novitax_naplokod + * + * @return self + */ + public function setNovitaxNaplokod($novitax_naplokod) + { + if (is_null($novitax_naplokod)) { + throw new \InvalidArgumentException('non-nullable novitax_naplokod cannot be null'); + } + $this->container['novitax_naplokod'] = $novitax_naplokod; + + return $this; + } + + /** + * Gets use_gross_values + * + * @return bool|null + */ + public function getUseGrossValues() + { + return $this->container['use_gross_values']; + } + + /** + * Sets use_gross_values + * + * @param bool|null $use_gross_values use_gross_values + * + * @return self + */ + public function setUseGrossValues($use_gross_values) + { + if (is_null($use_gross_values)) { + throw new \InvalidArgumentException('non-nullable use_gross_values cannot be null'); + } + $this->container['use_gross_values'] = $use_gross_values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentExportId.php b/lib/Model/DocumentExportId.php new file mode 100644 index 0000000..d32cac1 --- /dev/null +++ b/lib/Model/DocumentExportId.php @@ -0,0 +1,410 @@ + + */ +class DocumentExportId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentExportId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentExportOtherOptions.php b/lib/Model/DocumentExportOtherOptions.php new file mode 100644 index 0000000..a5e7355 --- /dev/null +++ b/lib/Model/DocumentExportOtherOptions.php @@ -0,0 +1,66 @@ + + */ +class DocumentExportStatus implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentExportStatus'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'state' => '\Cone\Billingo\Model\DocumentExportStatusState', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'state' => null, + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'state' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'state' => 'state', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'state' => 'setState', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'state' => 'getState', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets state + * + * @return \Cone\Billingo\Model\DocumentExportStatusState|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param \Cone\Billingo\Model\DocumentExportStatusState|null $state state + * + * @return self + */ + public function setState($state) + { + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentExportStatusState.php b/lib/Model/DocumentExportStatusState.php new file mode 100644 index 0000000..1005a88 --- /dev/null +++ b/lib/Model/DocumentExportStatusState.php @@ -0,0 +1,72 @@ + + */ +class DocumentInsert implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentInsert'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'vendor_id' => 'string', + 'partner_id' => 'int', + 'block_id' => 'int', + 'bank_account_id' => 'int', + 'type' => '\Cone\Billingo\Model\DocumentInsertType', + 'fulfillment_date' => '\DateTime', + 'due_date' => '\DateTime', + 'payment_method' => '\Cone\Billingo\Model\PaymentMethod', + 'language' => '\Cone\Billingo\Model\DocumentLanguage', + 'currency' => '\Cone\Billingo\Model\Currency', + 'conversion_rate' => 'float', + 'electronic' => 'bool', + 'paid' => 'bool', + 'items' => '\Cone\Billingo\Model\DocumentInsertItemsInner[]', + 'comment' => 'string', + 'settings' => '\Cone\Billingo\Model\DocumentSettings', + 'advance_invoice' => 'int[]', + 'discount' => '\Cone\Billingo\Model\Discount', + 'instant_payment' => 'bool', + 'instant_payment_request' => '\Cone\Billingo\Model\DocumentInsertInstantPaymentRequest' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'vendor_id' => null, + 'partner_id' => null, + 'block_id' => null, + 'bank_account_id' => null, + 'type' => null, + 'fulfillment_date' => 'date', + 'due_date' => 'date', + 'payment_method' => null, + 'language' => null, + 'currency' => null, + 'conversion_rate' => 'float', + 'electronic' => null, + 'paid' => null, + 'items' => null, + 'comment' => null, + 'settings' => null, + 'advance_invoice' => null, + 'discount' => null, + 'instant_payment' => null, + 'instant_payment_request' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'vendor_id' => false, + 'partner_id' => false, + 'block_id' => false, + 'bank_account_id' => false, + 'type' => false, + 'fulfillment_date' => false, + 'due_date' => false, + 'payment_method' => false, + 'language' => false, + 'currency' => false, + 'conversion_rate' => false, + 'electronic' => false, + 'paid' => false, + 'items' => false, + 'comment' => false, + 'settings' => false, + 'advance_invoice' => false, + 'discount' => false, + 'instant_payment' => false, + 'instant_payment_request' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'vendor_id' => 'vendor_id', + 'partner_id' => 'partner_id', + 'block_id' => 'block_id', + 'bank_account_id' => 'bank_account_id', + 'type' => 'type', + 'fulfillment_date' => 'fulfillment_date', + 'due_date' => 'due_date', + 'payment_method' => 'payment_method', + 'language' => 'language', + 'currency' => 'currency', + 'conversion_rate' => 'conversion_rate', + 'electronic' => 'electronic', + 'paid' => 'paid', + 'items' => 'items', + 'comment' => 'comment', + 'settings' => 'settings', + 'advance_invoice' => 'advance_invoice', + 'discount' => 'discount', + 'instant_payment' => 'instant_payment', + 'instant_payment_request' => 'instant_payment_request' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'vendor_id' => 'setVendorId', + 'partner_id' => 'setPartnerId', + 'block_id' => 'setBlockId', + 'bank_account_id' => 'setBankAccountId', + 'type' => 'setType', + 'fulfillment_date' => 'setFulfillmentDate', + 'due_date' => 'setDueDate', + 'payment_method' => 'setPaymentMethod', + 'language' => 'setLanguage', + 'currency' => 'setCurrency', + 'conversion_rate' => 'setConversionRate', + 'electronic' => 'setElectronic', + 'paid' => 'setPaid', + 'items' => 'setItems', + 'comment' => 'setComment', + 'settings' => 'setSettings', + 'advance_invoice' => 'setAdvanceInvoice', + 'discount' => 'setDiscount', + 'instant_payment' => 'setInstantPayment', + 'instant_payment_request' => 'setInstantPaymentRequest' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'vendor_id' => 'getVendorId', + 'partner_id' => 'getPartnerId', + 'block_id' => 'getBlockId', + 'bank_account_id' => 'getBankAccountId', + 'type' => 'getType', + 'fulfillment_date' => 'getFulfillmentDate', + 'due_date' => 'getDueDate', + 'payment_method' => 'getPaymentMethod', + 'language' => 'getLanguage', + 'currency' => 'getCurrency', + 'conversion_rate' => 'getConversionRate', + 'electronic' => 'getElectronic', + 'paid' => 'getPaid', + 'items' => 'getItems', + 'comment' => 'getComment', + 'settings' => 'getSettings', + 'advance_invoice' => 'getAdvanceInvoice', + 'discount' => 'getDiscount', + 'instant_payment' => 'getInstantPayment', + 'instant_payment_request' => 'getInstantPaymentRequest' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('vendor_id', $data ?? [], null); + $this->setIfExists('partner_id', $data ?? [], null); + $this->setIfExists('block_id', $data ?? [], null); + $this->setIfExists('bank_account_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('fulfillment_date', $data ?? [], null); + $this->setIfExists('due_date', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('language', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('conversion_rate', $data ?? [], null); + $this->setIfExists('electronic', $data ?? [], false); + $this->setIfExists('paid', $data ?? [], false); + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('comment', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); + $this->setIfExists('advance_invoice', $data ?? [], null); + $this->setIfExists('discount', $data ?? [], null); + $this->setIfExists('instant_payment', $data ?? [], null); + $this->setIfExists('instant_payment_request', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['partner_id'] === null) { + $invalidProperties[] = "'partner_id' can't be null"; + } + if ($this->container['block_id'] === null) { + $invalidProperties[] = "'block_id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['fulfillment_date'] === null) { + $invalidProperties[] = "'fulfillment_date' can't be null"; + } + if ($this->container['due_date'] === null) { + $invalidProperties[] = "'due_date' can't be null"; + } + if ($this->container['payment_method'] === null) { + $invalidProperties[] = "'payment_method' can't be null"; + } + if ($this->container['language'] === null) { + $invalidProperties[] = "'language' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets vendor_id + * + * @return string|null + */ + public function getVendorId() + { + return $this->container['vendor_id']; + } + + /** + * Sets vendor_id + * + * @param string|null $vendor_id vendor_id + * + * @return self + */ + public function setVendorId($vendor_id) + { + if (is_null($vendor_id)) { + throw new \InvalidArgumentException('non-nullable vendor_id cannot be null'); + } + $this->container['vendor_id'] = $vendor_id; + + return $this; + } + + /** + * Gets partner_id + * + * @return int + */ + public function getPartnerId() + { + return $this->container['partner_id']; + } + + /** + * Sets partner_id + * + * @param int $partner_id partner_id + * + * @return self + */ + public function setPartnerId($partner_id) + { + if (is_null($partner_id)) { + throw new \InvalidArgumentException('non-nullable partner_id cannot be null'); + } + $this->container['partner_id'] = $partner_id; + + return $this; + } + + /** + * Gets block_id + * + * @return int + */ + public function getBlockId() + { + return $this->container['block_id']; + } + + /** + * Sets block_id + * + * @param int $block_id block_id + * + * @return self + */ + public function setBlockId($block_id) + { + if (is_null($block_id)) { + throw new \InvalidArgumentException('non-nullable block_id cannot be null'); + } + $this->container['block_id'] = $block_id; + + return $this; + } + + /** + * Gets bank_account_id + * + * @return int|null + */ + public function getBankAccountId() + { + return $this->container['bank_account_id']; + } + + /** + * Sets bank_account_id + * + * @param int|null $bank_account_id bank_account_id + * + * @return self + */ + public function setBankAccountId($bank_account_id) + { + if (is_null($bank_account_id)) { + throw new \InvalidArgumentException('non-nullable bank_account_id cannot be null'); + } + $this->container['bank_account_id'] = $bank_account_id; + + return $this; + } + + /** + * Gets type + * + * @return \Cone\Billingo\Model\DocumentInsertType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Cone\Billingo\Model\DocumentInsertType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets fulfillment_date + * + * @return \DateTime + */ + public function getFulfillmentDate() + { + return $this->container['fulfillment_date']; + } + + /** + * Sets fulfillment_date + * + * @param \DateTime $fulfillment_date fulfillment_date + * + * @return self + */ + public function setFulfillmentDate($fulfillment_date) + { + if (is_null($fulfillment_date)) { + throw new \InvalidArgumentException('non-nullable fulfillment_date cannot be null'); + } + $this->container['fulfillment_date'] = $fulfillment_date; + + return $this; + } + + /** + * Gets due_date + * + * @return \DateTime + */ + public function getDueDate() + { + return $this->container['due_date']; + } + + /** + * Sets due_date + * + * @param \DateTime $due_date due_date + * + * @return self + */ + public function setDueDate($due_date) + { + if (is_null($due_date)) { + throw new \InvalidArgumentException('non-nullable due_date cannot be null'); + } + $this->container['due_date'] = $due_date; + + return $this; + } + + /** + * Gets payment_method + * + * @return \Cone\Billingo\Model\PaymentMethod + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Cone\Billingo\Model\PaymentMethod $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets language + * + * @return \Cone\Billingo\Model\DocumentLanguage + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param \Cone\Billingo\Model\DocumentLanguage $language language + * + * @return self + */ + public function setLanguage($language) + { + if (is_null($language)) { + throw new \InvalidArgumentException('non-nullable language cannot be null'); + } + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets currency + * + * @return \Cone\Billingo\Model\Currency + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param \Cone\Billingo\Model\Currency $currency currency + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets conversion_rate + * + * @return float|null + */ + public function getConversionRate() + { + return $this->container['conversion_rate']; + } + + /** + * Sets conversion_rate + * + * @param float|null $conversion_rate conversion_rate + * + * @return self + */ + public function setConversionRate($conversion_rate) + { + if (is_null($conversion_rate)) { + throw new \InvalidArgumentException('non-nullable conversion_rate cannot be null'); + } + $this->container['conversion_rate'] = $conversion_rate; + + return $this; + } + + /** + * Gets electronic + * + * @return bool|null + */ + public function getElectronic() + { + return $this->container['electronic']; + } + + /** + * Sets electronic + * + * @param bool|null $electronic electronic + * + * @return self + */ + public function setElectronic($electronic) + { + if (is_null($electronic)) { + throw new \InvalidArgumentException('non-nullable electronic cannot be null'); + } + $this->container['electronic'] = $electronic; + + return $this; + } + + /** + * Gets paid + * + * @return bool|null + */ + public function getPaid() + { + return $this->container['paid']; + } + + /** + * Sets paid + * + * @param bool|null $paid paid + * + * @return self + */ + public function setPaid($paid) + { + if (is_null($paid)) { + throw new \InvalidArgumentException('non-nullable paid cannot be null'); + } + $this->container['paid'] = $paid; + + return $this; + } + + /** + * Gets items + * + * @return \Cone\Billingo\Model\DocumentInsertItemsInner[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Cone\Billingo\Model\DocumentInsertItemsInner[]|null $items items + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets comment + * + * @return string|null + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string|null $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + throw new \InvalidArgumentException('non-nullable comment cannot be null'); + } + $this->container['comment'] = $comment; + + return $this; + } + + /** + * Gets settings + * + * @return \Cone\Billingo\Model\DocumentSettings|null + */ + public function getSettings() + { + return $this->container['settings']; + } + + /** + * Sets settings + * + * @param \Cone\Billingo\Model\DocumentSettings|null $settings settings + * + * @return self + */ + public function setSettings($settings) + { + if (is_null($settings)) { + throw new \InvalidArgumentException('non-nullable settings cannot be null'); + } + $this->container['settings'] = $settings; + + return $this; + } + + /** + * Gets advance_invoice + * + * @return int[]|null + */ + public function getAdvanceInvoice() + { + return $this->container['advance_invoice']; + } + + /** + * Sets advance_invoice + * + * @param int[]|null $advance_invoice advance_invoice + * + * @return self + */ + public function setAdvanceInvoice($advance_invoice) + { + if (is_null($advance_invoice)) { + throw new \InvalidArgumentException('non-nullable advance_invoice cannot be null'); + } + $this->container['advance_invoice'] = $advance_invoice; + + return $this; + } + + /** + * Gets discount + * + * @return \Cone\Billingo\Model\Discount|null + */ + public function getDiscount() + { + return $this->container['discount']; + } + + /** + * Sets discount + * + * @param \Cone\Billingo\Model\Discount|null $discount discount + * + * @return self + */ + public function setDiscount($discount) + { + if (is_null($discount)) { + throw new \InvalidArgumentException('non-nullable discount cannot be null'); + } + $this->container['discount'] = $discount; + + return $this; + } + + /** + * Gets instant_payment + * + * @return bool|null + */ + public function getInstantPayment() + { + return $this->container['instant_payment']; + } + + /** + * Sets instant_payment + * + * @param bool|null $instant_payment instant_payment + * + * @return self + */ + public function setInstantPayment($instant_payment) + { + if (is_null($instant_payment)) { + throw new \InvalidArgumentException('non-nullable instant_payment cannot be null'); + } + $this->container['instant_payment'] = $instant_payment; + + return $this; + } + + /** + * Gets instant_payment_request + * + * @return \Cone\Billingo\Model\DocumentInsertInstantPaymentRequest|null + */ + public function getInstantPaymentRequest() + { + return $this->container['instant_payment_request']; + } + + /** + * Sets instant_payment_request + * + * @param \Cone\Billingo\Model\DocumentInsertInstantPaymentRequest|null $instant_payment_request instant_payment_request + * + * @return self + */ + public function setInstantPaymentRequest($instant_payment_request) + { + if (is_null($instant_payment_request)) { + array_push($this->openAPINullablesSetToNull, 'instant_payment_request'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('instant_payment_request', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['instant_payment_request'] = $instant_payment_request; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentInsertInstantPaymentRequest.php b/lib/Model/DocumentInsertInstantPaymentRequest.php new file mode 100644 index 0000000..5a51fe1 --- /dev/null +++ b/lib/Model/DocumentInsertInstantPaymentRequest.php @@ -0,0 +1,478 @@ + + */ +class DocumentInsertInstantPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentInsert_instant_payment_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'debtor_bank_account' => 'string', + 'different_amount_allowed' => 'bool', + 'update_partner_payment_details' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'debtor_bank_account' => null, + 'different_amount_allowed' => null, + 'update_partner_payment_details' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'debtor_bank_account' => false, + 'different_amount_allowed' => false, + 'update_partner_payment_details' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'debtor_bank_account' => 'debtor_bank_account', + 'different_amount_allowed' => 'different_amount_allowed', + 'update_partner_payment_details' => 'update_partner_payment_details' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'debtor_bank_account' => 'setDebtorBankAccount', + 'different_amount_allowed' => 'setDifferentAmountAllowed', + 'update_partner_payment_details' => 'setUpdatePartnerPaymentDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'debtor_bank_account' => 'getDebtorBankAccount', + 'different_amount_allowed' => 'getDifferentAmountAllowed', + 'update_partner_payment_details' => 'getUpdatePartnerPaymentDetails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('debtor_bank_account', $data ?? [], null); + $this->setIfExists('different_amount_allowed', $data ?? [], null); + $this->setIfExists('update_partner_payment_details', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets debtor_bank_account + * + * @return string|null + */ + public function getDebtorBankAccount() + { + return $this->container['debtor_bank_account']; + } + + /** + * Sets debtor_bank_account + * + * @param string|null $debtor_bank_account debtor_bank_account + * + * @return self + */ + public function setDebtorBankAccount($debtor_bank_account) + { + if (is_null($debtor_bank_account)) { + throw new \InvalidArgumentException('non-nullable debtor_bank_account cannot be null'); + } + $this->container['debtor_bank_account'] = $debtor_bank_account; + + return $this; + } + + /** + * Gets different_amount_allowed + * + * @return bool|null + */ + public function getDifferentAmountAllowed() + { + return $this->container['different_amount_allowed']; + } + + /** + * Sets different_amount_allowed + * + * @param bool|null $different_amount_allowed different_amount_allowed + * + * @return self + */ + public function setDifferentAmountAllowed($different_amount_allowed) + { + if (is_null($different_amount_allowed)) { + throw new \InvalidArgumentException('non-nullable different_amount_allowed cannot be null'); + } + $this->container['different_amount_allowed'] = $different_amount_allowed; + + return $this; + } + + /** + * Gets update_partner_payment_details + * + * @return bool|null + */ + public function getUpdatePartnerPaymentDetails() + { + return $this->container['update_partner_payment_details']; + } + + /** + * Sets update_partner_payment_details + * + * @param bool|null $update_partner_payment_details update_partner_payment_details + * + * @return self + */ + public function setUpdatePartnerPaymentDetails($update_partner_payment_details) + { + if (is_null($update_partner_payment_details)) { + throw new \InvalidArgumentException('non-nullable update_partner_payment_details cannot be null'); + } + $this->container['update_partner_payment_details'] = $update_partner_payment_details; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentInsertItemsInner.php b/lib/Model/DocumentInsertItemsInner.php new file mode 100644 index 0000000..bfc6c9c --- /dev/null +++ b/lib/Model/DocumentInsertItemsInner.php @@ -0,0 +1,737 @@ + + */ +class DocumentInsertItemsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentInsert_items_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'product_id' => 'int', + 'quantity' => 'float', + 'comment' => 'string', + 'name' => 'string', + 'unit_price' => 'float', + 'unit_price_type' => '\Cone\Billingo\Model\UnitPriceType', + 'unit' => 'string', + 'vat' => '\Cone\Billingo\Model\Vat', + 'entitlement' => '\Cone\Billingo\Model\Entitlement', + 'sku' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'product_id' => null, + 'quantity' => 'float', + 'comment' => null, + 'name' => null, + 'unit_price' => 'float', + 'unit_price_type' => null, + 'unit' => null, + 'vat' => null, + 'entitlement' => null, + 'sku' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'product_id' => false, + 'quantity' => false, + 'comment' => false, + 'name' => false, + 'unit_price' => false, + 'unit_price_type' => false, + 'unit' => false, + 'vat' => false, + 'entitlement' => false, + 'sku' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_id' => 'product_id', + 'quantity' => 'quantity', + 'comment' => 'comment', + 'name' => 'name', + 'unit_price' => 'unit_price', + 'unit_price_type' => 'unit_price_type', + 'unit' => 'unit', + 'vat' => 'vat', + 'entitlement' => 'entitlement', + 'sku' => 'sku' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_id' => 'setProductId', + 'quantity' => 'setQuantity', + 'comment' => 'setComment', + 'name' => 'setName', + 'unit_price' => 'setUnitPrice', + 'unit_price_type' => 'setUnitPriceType', + 'unit' => 'setUnit', + 'vat' => 'setVat', + 'entitlement' => 'setEntitlement', + 'sku' => 'setSku' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_id' => 'getProductId', + 'quantity' => 'getQuantity', + 'comment' => 'getComment', + 'name' => 'getName', + 'unit_price' => 'getUnitPrice', + 'unit_price_type' => 'getUnitPriceType', + 'unit' => 'getUnit', + 'vat' => 'getVat', + 'entitlement' => 'getEntitlement', + 'sku' => 'getSku' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('product_id', $data ?? [], null); + $this->setIfExists('quantity', $data ?? [], null); + $this->setIfExists('comment', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('unit_price', $data ?? [], null); + $this->setIfExists('unit_price_type', $data ?? [], null); + $this->setIfExists('unit', $data ?? [], null); + $this->setIfExists('vat', $data ?? [], null); + $this->setIfExists('entitlement', $data ?? [], null); + $this->setIfExists('sku', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['product_id'] === null) { + $invalidProperties[] = "'product_id' can't be null"; + } + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['unit_price'] === null) { + $invalidProperties[] = "'unit_price' can't be null"; + } + if ($this->container['unit_price_type'] === null) { + $invalidProperties[] = "'unit_price_type' can't be null"; + } + if ($this->container['unit'] === null) { + $invalidProperties[] = "'unit' can't be null"; + } + if ($this->container['vat'] === null) { + $invalidProperties[] = "'vat' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets product_id + * + * @return int + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int $product_id product_id + * + * @return self + */ + public function setProductId($product_id) + { + if (is_null($product_id)) { + throw new \InvalidArgumentException('non-nullable product_id cannot be null'); + } + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets quantity + * + * @return float + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param float $quantity quantity + * + * @return self + */ + public function setQuantity($quantity) + { + if (is_null($quantity)) { + throw new \InvalidArgumentException('non-nullable quantity cannot be null'); + } + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets comment + * + * @return string|null + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string|null $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + throw new \InvalidArgumentException('non-nullable comment cannot be null'); + } + $this->container['comment'] = $comment; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets unit_price + * + * @return float + */ + public function getUnitPrice() + { + return $this->container['unit_price']; + } + + /** + * Sets unit_price + * + * @param float $unit_price unit_price + * + * @return self + */ + public function setUnitPrice($unit_price) + { + if (is_null($unit_price)) { + throw new \InvalidArgumentException('non-nullable unit_price cannot be null'); + } + $this->container['unit_price'] = $unit_price; + + return $this; + } + + /** + * Gets unit_price_type + * + * @return \Cone\Billingo\Model\UnitPriceType + */ + public function getUnitPriceType() + { + return $this->container['unit_price_type']; + } + + /** + * Sets unit_price_type + * + * @param \Cone\Billingo\Model\UnitPriceType $unit_price_type unit_price_type + * + * @return self + */ + public function setUnitPriceType($unit_price_type) + { + if (is_null($unit_price_type)) { + throw new \InvalidArgumentException('non-nullable unit_price_type cannot be null'); + } + $this->container['unit_price_type'] = $unit_price_type; + + return $this; + } + + /** + * Gets unit + * + * @return string + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string $unit unit + * + * @return self + */ + public function setUnit($unit) + { + if (is_null($unit)) { + throw new \InvalidArgumentException('non-nullable unit cannot be null'); + } + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets vat + * + * @return \Cone\Billingo\Model\Vat + */ + public function getVat() + { + return $this->container['vat']; + } + + /** + * Sets vat + * + * @param \Cone\Billingo\Model\Vat $vat vat + * + * @return self + */ + public function setVat($vat) + { + if (is_null($vat)) { + throw new \InvalidArgumentException('non-nullable vat cannot be null'); + } + $this->container['vat'] = $vat; + + return $this; + } + + /** + * Gets entitlement + * + * @return \Cone\Billingo\Model\Entitlement|null + */ + public function getEntitlement() + { + return $this->container['entitlement']; + } + + /** + * Sets entitlement + * + * @param \Cone\Billingo\Model\Entitlement|null $entitlement entitlement + * + * @return self + */ + public function setEntitlement($entitlement) + { + if (is_null($entitlement)) { + throw new \InvalidArgumentException('non-nullable entitlement cannot be null'); + } + $this->container['entitlement'] = $entitlement; + + return $this; + } + + /** + * Gets sku + * + * @return string|null + */ + public function getSku() + { + return $this->container['sku']; + } + + /** + * Sets sku + * + * @param string|null $sku sku + * + * @return self + */ + public function setSku($sku) + { + if (is_null($sku)) { + throw new \InvalidArgumentException('non-nullable sku cannot be null'); + } + $this->container['sku'] = $sku; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentInsertType.php b/lib/Model/DocumentInsertType.php new file mode 100644 index 0000000..4c7204c --- /dev/null +++ b/lib/Model/DocumentInsertType.php @@ -0,0 +1,69 @@ + + */ +class DocumentInstantPaymentRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentInstantPaymentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'debtor_bank_account' => 'string', + 'different_amount_allowed' => 'bool', + 'update_partner_payment_details' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'debtor_bank_account' => null, + 'different_amount_allowed' => null, + 'update_partner_payment_details' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'debtor_bank_account' => false, + 'different_amount_allowed' => false, + 'update_partner_payment_details' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'debtor_bank_account' => 'debtor_bank_account', + 'different_amount_allowed' => 'different_amount_allowed', + 'update_partner_payment_details' => 'update_partner_payment_details' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'debtor_bank_account' => 'setDebtorBankAccount', + 'different_amount_allowed' => 'setDifferentAmountAllowed', + 'update_partner_payment_details' => 'setUpdatePartnerPaymentDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'debtor_bank_account' => 'getDebtorBankAccount', + 'different_amount_allowed' => 'getDifferentAmountAllowed', + 'update_partner_payment_details' => 'getUpdatePartnerPaymentDetails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('debtor_bank_account', $data ?? [], null); + $this->setIfExists('different_amount_allowed', $data ?? [], null); + $this->setIfExists('update_partner_payment_details', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets debtor_bank_account + * + * @return string|null + */ + public function getDebtorBankAccount() + { + return $this->container['debtor_bank_account']; + } + + /** + * Sets debtor_bank_account + * + * @param string|null $debtor_bank_account debtor_bank_account + * + * @return self + */ + public function setDebtorBankAccount($debtor_bank_account) + { + if (is_null($debtor_bank_account)) { + throw new \InvalidArgumentException('non-nullable debtor_bank_account cannot be null'); + } + $this->container['debtor_bank_account'] = $debtor_bank_account; + + return $this; + } + + /** + * Gets different_amount_allowed + * + * @return bool|null + */ + public function getDifferentAmountAllowed() + { + return $this->container['different_amount_allowed']; + } + + /** + * Sets different_amount_allowed + * + * @param bool|null $different_amount_allowed different_amount_allowed + * + * @return self + */ + public function setDifferentAmountAllowed($different_amount_allowed) + { + if (is_null($different_amount_allowed)) { + throw new \InvalidArgumentException('non-nullable different_amount_allowed cannot be null'); + } + $this->container['different_amount_allowed'] = $different_amount_allowed; + + return $this; + } + + /** + * Gets update_partner_payment_details + * + * @return bool|null + */ + public function getUpdatePartnerPaymentDetails() + { + return $this->container['update_partner_payment_details']; + } + + /** + * Sets update_partner_payment_details + * + * @param bool|null $update_partner_payment_details update_partner_payment_details + * + * @return self + */ + public function setUpdatePartnerPaymentDetails($update_partner_payment_details) + { + if (is_null($update_partner_payment_details)) { + throw new \InvalidArgumentException('non-nullable update_partner_payment_details cannot be null'); + } + $this->container['update_partner_payment_details'] = $update_partner_payment_details; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentItem.php b/lib/Model/DocumentItem.php new file mode 100644 index 0000000..e0e33a5 --- /dev/null +++ b/lib/Model/DocumentItem.php @@ -0,0 +1,791 @@ + + */ +class DocumentItem implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'product_id' => 'int', + 'name' => 'string', + 'net_unit_amount' => 'float', + 'quantity' => 'float', + 'unit' => 'string', + 'net_amount' => 'float', + 'gross_amount' => 'float', + 'vat' => '\Cone\Billingo\Model\Vat', + 'vat_amount' => 'float', + 'entitlement' => '\Cone\Billingo\Model\Entitlement', + 'comment' => 'string', + 'sku' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'product_id' => null, + 'name' => null, + 'net_unit_amount' => 'float', + 'quantity' => 'float', + 'unit' => null, + 'net_amount' => 'float', + 'gross_amount' => 'float', + 'vat' => null, + 'vat_amount' => 'float', + 'entitlement' => null, + 'comment' => null, + 'sku' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'product_id' => true, + 'name' => false, + 'net_unit_amount' => false, + 'quantity' => false, + 'unit' => false, + 'net_amount' => false, + 'gross_amount' => false, + 'vat' => false, + 'vat_amount' => false, + 'entitlement' => false, + 'comment' => false, + 'sku' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_id' => 'product_id', + 'name' => 'name', + 'net_unit_amount' => 'net_unit_amount', + 'quantity' => 'quantity', + 'unit' => 'unit', + 'net_amount' => 'net_amount', + 'gross_amount' => 'gross_amount', + 'vat' => 'vat', + 'vat_amount' => 'vat_amount', + 'entitlement' => 'entitlement', + 'comment' => 'comment', + 'sku' => 'sku' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_id' => 'setProductId', + 'name' => 'setName', + 'net_unit_amount' => 'setNetUnitAmount', + 'quantity' => 'setQuantity', + 'unit' => 'setUnit', + 'net_amount' => 'setNetAmount', + 'gross_amount' => 'setGrossAmount', + 'vat' => 'setVat', + 'vat_amount' => 'setVatAmount', + 'entitlement' => 'setEntitlement', + 'comment' => 'setComment', + 'sku' => 'setSku' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_id' => 'getProductId', + 'name' => 'getName', + 'net_unit_amount' => 'getNetUnitAmount', + 'quantity' => 'getQuantity', + 'unit' => 'getUnit', + 'net_amount' => 'getNetAmount', + 'gross_amount' => 'getGrossAmount', + 'vat' => 'getVat', + 'vat_amount' => 'getVatAmount', + 'entitlement' => 'getEntitlement', + 'comment' => 'getComment', + 'sku' => 'getSku' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('product_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('net_unit_amount', $data ?? [], null); + $this->setIfExists('quantity', $data ?? [], null); + $this->setIfExists('unit', $data ?? [], null); + $this->setIfExists('net_amount', $data ?? [], null); + $this->setIfExists('gross_amount', $data ?? [], null); + $this->setIfExists('vat', $data ?? [], null); + $this->setIfExists('vat_amount', $data ?? [], null); + $this->setIfExists('entitlement', $data ?? [], null); + $this->setIfExists('comment', $data ?? [], null); + $this->setIfExists('sku', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets product_id + * + * @return int|null + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int|null $product_id product_id + * + * @return self + */ + public function setProductId($product_id) + { + if (is_null($product_id)) { + array_push($this->openAPINullablesSetToNull, 'product_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('product_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets net_unit_amount + * + * @return float|null + */ + public function getNetUnitAmount() + { + return $this->container['net_unit_amount']; + } + + /** + * Sets net_unit_amount + * + * @param float|null $net_unit_amount net_unit_amount + * + * @return self + */ + public function setNetUnitAmount($net_unit_amount) + { + if (is_null($net_unit_amount)) { + throw new \InvalidArgumentException('non-nullable net_unit_amount cannot be null'); + } + $this->container['net_unit_amount'] = $net_unit_amount; + + return $this; + } + + /** + * Gets quantity + * + * @return float|null + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param float|null $quantity quantity + * + * @return self + */ + public function setQuantity($quantity) + { + if (is_null($quantity)) { + throw new \InvalidArgumentException('non-nullable quantity cannot be null'); + } + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets unit + * + * @return string|null + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string|null $unit unit + * + * @return self + */ + public function setUnit($unit) + { + if (is_null($unit)) { + throw new \InvalidArgumentException('non-nullable unit cannot be null'); + } + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets net_amount + * + * @return float|null + */ + public function getNetAmount() + { + return $this->container['net_amount']; + } + + /** + * Sets net_amount + * + * @param float|null $net_amount net_amount + * + * @return self + */ + public function setNetAmount($net_amount) + { + if (is_null($net_amount)) { + throw new \InvalidArgumentException('non-nullable net_amount cannot be null'); + } + $this->container['net_amount'] = $net_amount; + + return $this; + } + + /** + * Gets gross_amount + * + * @return float|null + */ + public function getGrossAmount() + { + return $this->container['gross_amount']; + } + + /** + * Sets gross_amount + * + * @param float|null $gross_amount gross_amount + * + * @return self + */ + public function setGrossAmount($gross_amount) + { + if (is_null($gross_amount)) { + throw new \InvalidArgumentException('non-nullable gross_amount cannot be null'); + } + $this->container['gross_amount'] = $gross_amount; + + return $this; + } + + /** + * Gets vat + * + * @return \Cone\Billingo\Model\Vat|null + */ + public function getVat() + { + return $this->container['vat']; + } + + /** + * Sets vat + * + * @param \Cone\Billingo\Model\Vat|null $vat vat + * + * @return self + */ + public function setVat($vat) + { + if (is_null($vat)) { + throw new \InvalidArgumentException('non-nullable vat cannot be null'); + } + $this->container['vat'] = $vat; + + return $this; + } + + /** + * Gets vat_amount + * + * @return float|null + */ + public function getVatAmount() + { + return $this->container['vat_amount']; + } + + /** + * Sets vat_amount + * + * @param float|null $vat_amount vat_amount + * + * @return self + */ + public function setVatAmount($vat_amount) + { + if (is_null($vat_amount)) { + throw new \InvalidArgumentException('non-nullable vat_amount cannot be null'); + } + $this->container['vat_amount'] = $vat_amount; + + return $this; + } + + /** + * Gets entitlement + * + * @return \Cone\Billingo\Model\Entitlement|null + */ + public function getEntitlement() + { + return $this->container['entitlement']; + } + + /** + * Sets entitlement + * + * @param \Cone\Billingo\Model\Entitlement|null $entitlement entitlement + * + * @return self + */ + public function setEntitlement($entitlement) + { + if (is_null($entitlement)) { + throw new \InvalidArgumentException('non-nullable entitlement cannot be null'); + } + $this->container['entitlement'] = $entitlement; + + return $this; + } + + /** + * Gets comment + * + * @return string|null + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string|null $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + throw new \InvalidArgumentException('non-nullable comment cannot be null'); + } + $this->container['comment'] = $comment; + + return $this; + } + + /** + * Gets sku + * + * @return string|null + */ + public function getSku() + { + return $this->container['sku']; + } + + /** + * Sets sku + * + * @param string|null $sku sku + * + * @return self + */ + public function setSku($sku) + { + if (is_null($sku)) { + throw new \InvalidArgumentException('non-nullable sku cannot be null'); + } + $this->container['sku'] = $sku; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentItemData.php b/lib/Model/DocumentItemData.php new file mode 100644 index 0000000..4525494 --- /dev/null +++ b/lib/Model/DocumentItemData.php @@ -0,0 +1,484 @@ + + */ +class DocumentItemData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentItemData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'product_id' => 'int', + 'quantity' => 'float', + 'comment' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'product_id' => null, + 'quantity' => 'float', + 'comment' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'product_id' => false, + 'quantity' => false, + 'comment' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_id' => 'product_id', + 'quantity' => 'quantity', + 'comment' => 'comment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_id' => 'setProductId', + 'quantity' => 'setQuantity', + 'comment' => 'setComment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_id' => 'getProductId', + 'quantity' => 'getQuantity', + 'comment' => 'getComment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('product_id', $data ?? [], null); + $this->setIfExists('quantity', $data ?? [], null); + $this->setIfExists('comment', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['product_id'] === null) { + $invalidProperties[] = "'product_id' can't be null"; + } + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets product_id + * + * @return int + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int $product_id product_id + * + * @return self + */ + public function setProductId($product_id) + { + if (is_null($product_id)) { + throw new \InvalidArgumentException('non-nullable product_id cannot be null'); + } + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets quantity + * + * @return float + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param float $quantity quantity + * + * @return self + */ + public function setQuantity($quantity) + { + if (is_null($quantity)) { + throw new \InvalidArgumentException('non-nullable quantity cannot be null'); + } + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets comment + * + * @return string|null + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string|null $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + throw new \InvalidArgumentException('non-nullable comment cannot be null'); + } + $this->container['comment'] = $comment; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentLanguage.php b/lib/Model/DocumentLanguage.php new file mode 100644 index 0000000..e6e8edd --- /dev/null +++ b/lib/Model/DocumentLanguage.php @@ -0,0 +1,84 @@ + + */ +class DocumentList implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentList'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Cone\Billingo\Model\Document[]', + 'total' => 'int', + 'per_page' => 'int', + 'current_page' => 'int', + 'last_page' => 'int', + 'prev_page_url' => 'string', + 'next_page_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'total' => null, + 'per_page' => null, + 'current_page' => null, + 'last_page' => null, + 'prev_page_url' => null, + 'next_page_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false, + 'total' => false, + 'per_page' => false, + 'current_page' => false, + 'last_page' => false, + 'prev_page_url' => false, + 'next_page_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'total' => 'total', + 'per_page' => 'per_page', + 'current_page' => 'current_page', + 'last_page' => 'last_page', + 'prev_page_url' => 'prev_page_url', + 'next_page_url' => 'next_page_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'total' => 'setTotal', + 'per_page' => 'setPerPage', + 'current_page' => 'setCurrentPage', + 'last_page' => 'setLastPage', + 'prev_page_url' => 'setPrevPageUrl', + 'next_page_url' => 'setNextPageUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'total' => 'getTotal', + 'per_page' => 'getPerPage', + 'current_page' => 'getCurrentPage', + 'last_page' => 'getLastPage', + 'prev_page_url' => 'getPrevPageUrl', + 'next_page_url' => 'getNextPageUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('per_page', $data ?? [], null); + $this->setIfExists('current_page', $data ?? [], null); + $this->setIfExists('last_page', $data ?? [], null); + $this->setIfExists('prev_page_url', $data ?? [], null); + $this->setIfExists('next_page_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Cone\Billingo\Model\Document[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Cone\Billingo\Model\Document[]|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets total + * + * @return int|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int|null $total total + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets per_page + * + * @return int|null + */ + public function getPerPage() + { + return $this->container['per_page']; + } + + /** + * Sets per_page + * + * @param int|null $per_page per_page + * + * @return self + */ + public function setPerPage($per_page) + { + if (is_null($per_page)) { + throw new \InvalidArgumentException('non-nullable per_page cannot be null'); + } + $this->container['per_page'] = $per_page; + + return $this; + } + + /** + * Gets current_page + * + * @return int|null + */ + public function getCurrentPage() + { + return $this->container['current_page']; + } + + /** + * Sets current_page + * + * @param int|null $current_page current_page + * + * @return self + */ + public function setCurrentPage($current_page) + { + if (is_null($current_page)) { + throw new \InvalidArgumentException('non-nullable current_page cannot be null'); + } + $this->container['current_page'] = $current_page; + + return $this; + } + + /** + * Gets last_page + * + * @return int|null + */ + public function getLastPage() + { + return $this->container['last_page']; + } + + /** + * Sets last_page + * + * @param int|null $last_page last_page + * + * @return self + */ + public function setLastPage($last_page) + { + if (is_null($last_page)) { + throw new \InvalidArgumentException('non-nullable last_page cannot be null'); + } + $this->container['last_page'] = $last_page; + + return $this; + } + + /** + * Gets prev_page_url + * + * @return string|null + */ + public function getPrevPageUrl() + { + return $this->container['prev_page_url']; + } + + /** + * Sets prev_page_url + * + * @param string|null $prev_page_url prev_page_url + * + * @return self + */ + public function setPrevPageUrl($prev_page_url) + { + if (is_null($prev_page_url)) { + throw new \InvalidArgumentException('non-nullable prev_page_url cannot be null'); + } + $this->container['prev_page_url'] = $prev_page_url; + + return $this; + } + + /** + * Gets next_page_url + * + * @return string|null + */ + public function getNextPageUrl() + { + return $this->container['next_page_url']; + } + + /** + * Sets next_page_url + * + * @param string|null $next_page_url next_page_url + * + * @return self + */ + public function setNextPageUrl($next_page_url) + { + if (is_null($next_page_url)) { + throw new \InvalidArgumentException('non-nullable next_page_url cannot be null'); + } + $this->container['next_page_url'] = $next_page_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentNotificationStatus.php b/lib/Model/DocumentNotificationStatus.php new file mode 100644 index 0000000..6b327a7 --- /dev/null +++ b/lib/Model/DocumentNotificationStatus.php @@ -0,0 +1,75 @@ + + */ +class DocumentOrganization implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentOrganization'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'tax_number' => 'string', + 'bank_account' => '\Cone\Billingo\Model\DocumentBankAccount', + 'address' => '\Cone\Billingo\Model\Address', + 'small_taxpayer' => 'bool', + 'ev_number' => 'string', + 'eu_tax_number' => 'string', + 'cash_settled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'tax_number' => null, + 'bank_account' => null, + 'address' => null, + 'small_taxpayer' => null, + 'ev_number' => null, + 'eu_tax_number' => null, + 'cash_settled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'tax_number' => false, + 'bank_account' => false, + 'address' => false, + 'small_taxpayer' => false, + 'ev_number' => false, + 'eu_tax_number' => false, + 'cash_settled' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'tax_number' => 'tax_number', + 'bank_account' => 'bank_account', + 'address' => 'address', + 'small_taxpayer' => 'small_taxpayer', + 'ev_number' => 'ev_number', + 'eu_tax_number' => 'eu_tax_number', + 'cash_settled' => 'cash_settled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'tax_number' => 'setTaxNumber', + 'bank_account' => 'setBankAccount', + 'address' => 'setAddress', + 'small_taxpayer' => 'setSmallTaxpayer', + 'ev_number' => 'setEvNumber', + 'eu_tax_number' => 'setEuTaxNumber', + 'cash_settled' => 'setCashSettled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'tax_number' => 'getTaxNumber', + 'bank_account' => 'getBankAccount', + 'address' => 'getAddress', + 'small_taxpayer' => 'getSmallTaxpayer', + 'ev_number' => 'getEvNumber', + 'eu_tax_number' => 'getEuTaxNumber', + 'cash_settled' => 'getCashSettled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('tax_number', $data ?? [], null); + $this->setIfExists('bank_account', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('small_taxpayer', $data ?? [], null); + $this->setIfExists('ev_number', $data ?? [], null); + $this->setIfExists('eu_tax_number', $data ?? [], null); + $this->setIfExists('cash_settled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets tax_number + * + * @return string|null + */ + public function getTaxNumber() + { + return $this->container['tax_number']; + } + + /** + * Sets tax_number + * + * @param string|null $tax_number tax_number + * + * @return self + */ + public function setTaxNumber($tax_number) + { + if (is_null($tax_number)) { + throw new \InvalidArgumentException('non-nullable tax_number cannot be null'); + } + $this->container['tax_number'] = $tax_number; + + return $this; + } + + /** + * Gets bank_account + * + * @return \Cone\Billingo\Model\DocumentBankAccount|null + */ + public function getBankAccount() + { + return $this->container['bank_account']; + } + + /** + * Sets bank_account + * + * @param \Cone\Billingo\Model\DocumentBankAccount|null $bank_account bank_account + * + * @return self + */ + public function setBankAccount($bank_account) + { + if (is_null($bank_account)) { + throw new \InvalidArgumentException('non-nullable bank_account cannot be null'); + } + $this->container['bank_account'] = $bank_account; + + return $this; + } + + /** + * Gets address + * + * @return \Cone\Billingo\Model\Address|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Cone\Billingo\Model\Address|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets small_taxpayer + * + * @return bool|null + */ + public function getSmallTaxpayer() + { + return $this->container['small_taxpayer']; + } + + /** + * Sets small_taxpayer + * + * @param bool|null $small_taxpayer small_taxpayer + * + * @return self + */ + public function setSmallTaxpayer($small_taxpayer) + { + if (is_null($small_taxpayer)) { + throw new \InvalidArgumentException('non-nullable small_taxpayer cannot be null'); + } + $this->container['small_taxpayer'] = $small_taxpayer; + + return $this; + } + + /** + * Gets ev_number + * + * @return string|null + */ + public function getEvNumber() + { + return $this->container['ev_number']; + } + + /** + * Sets ev_number + * + * @param string|null $ev_number ev_number + * + * @return self + */ + public function setEvNumber($ev_number) + { + if (is_null($ev_number)) { + throw new \InvalidArgumentException('non-nullable ev_number cannot be null'); + } + $this->container['ev_number'] = $ev_number; + + return $this; + } + + /** + * Gets eu_tax_number + * + * @return string|null + */ + public function getEuTaxNumber() + { + return $this->container['eu_tax_number']; + } + + /** + * Sets eu_tax_number + * + * @param string|null $eu_tax_number eu_tax_number + * + * @return self + */ + public function setEuTaxNumber($eu_tax_number) + { + if (is_null($eu_tax_number)) { + throw new \InvalidArgumentException('non-nullable eu_tax_number cannot be null'); + } + $this->container['eu_tax_number'] = $eu_tax_number; + + return $this; + } + + /** + * Gets cash_settled + * + * @return bool|null + */ + public function getCashSettled() + { + return $this->container['cash_settled']; + } + + /** + * Sets cash_settled + * + * @param bool|null $cash_settled cash_settled + * + * @return self + */ + public function setCashSettled($cash_settled) + { + if (is_null($cash_settled)) { + throw new \InvalidArgumentException('non-nullable cash_settled cannot be null'); + } + $this->container['cash_settled'] = $cash_settled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentPartner.php b/lib/Model/DocumentPartner.php new file mode 100644 index 0000000..179a9b3 --- /dev/null +++ b/lib/Model/DocumentPartner.php @@ -0,0 +1,757 @@ + + */ +class DocumentPartner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentPartner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'address' => '\Cone\Billingo\Model\Address', + 'emails' => 'string[]', + 'taxcode' => 'string', + 'iban' => 'string', + 'swift' => 'string', + 'account_number' => 'string', + 'phone' => 'string', + 'tax_type' => '\Cone\Billingo\Model\PartnerTaxType', + 'partner_shipping' => '\Cone\Billingo\Model\DocumentPartnerPartnerShipping' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'address' => null, + 'emails' => null, + 'taxcode' => null, + 'iban' => null, + 'swift' => null, + 'account_number' => null, + 'phone' => null, + 'tax_type' => null, + 'partner_shipping' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'address' => false, + 'emails' => false, + 'taxcode' => false, + 'iban' => false, + 'swift' => false, + 'account_number' => false, + 'phone' => false, + 'tax_type' => false, + 'partner_shipping' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'address' => 'address', + 'emails' => 'emails', + 'taxcode' => 'taxcode', + 'iban' => 'iban', + 'swift' => 'swift', + 'account_number' => 'account_number', + 'phone' => 'phone', + 'tax_type' => 'tax_type', + 'partner_shipping' => 'partner_shipping' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'address' => 'setAddress', + 'emails' => 'setEmails', + 'taxcode' => 'setTaxcode', + 'iban' => 'setIban', + 'swift' => 'setSwift', + 'account_number' => 'setAccountNumber', + 'phone' => 'setPhone', + 'tax_type' => 'setTaxType', + 'partner_shipping' => 'setPartnerShipping' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'address' => 'getAddress', + 'emails' => 'getEmails', + 'taxcode' => 'getTaxcode', + 'iban' => 'getIban', + 'swift' => 'getSwift', + 'account_number' => 'getAccountNumber', + 'phone' => 'getPhone', + 'tax_type' => 'getTaxType', + 'partner_shipping' => 'getPartnerShipping' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('emails', $data ?? [], null); + $this->setIfExists('taxcode', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('swift', $data ?? [], null); + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('phone', $data ?? [], null); + $this->setIfExists('tax_type', $data ?? [], null); + $this->setIfExists('partner_shipping', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets address + * + * @return \Cone\Billingo\Model\Address|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Cone\Billingo\Model\Address|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets emails + * + * @return string[]|null + */ + public function getEmails() + { + return $this->container['emails']; + } + + /** + * Sets emails + * + * @param string[]|null $emails emails + * + * @return self + */ + public function setEmails($emails) + { + if (is_null($emails)) { + throw new \InvalidArgumentException('non-nullable emails cannot be null'); + } + $this->container['emails'] = $emails; + + return $this; + } + + /** + * Gets taxcode + * + * @return string|null + */ + public function getTaxcode() + { + return $this->container['taxcode']; + } + + /** + * Sets taxcode + * + * @param string|null $taxcode taxcode + * + * @return self + */ + public function setTaxcode($taxcode) + { + if (is_null($taxcode)) { + throw new \InvalidArgumentException('non-nullable taxcode cannot be null'); + } + $this->container['taxcode'] = $taxcode; + + return $this; + } + + /** + * Gets iban + * + * @return string|null + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string|null $iban iban + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets swift + * + * @return string|null + */ + public function getSwift() + { + return $this->container['swift']; + } + + /** + * Sets swift + * + * @param string|null $swift swift + * + * @return self + */ + public function setSwift($swift) + { + if (is_null($swift)) { + throw new \InvalidArgumentException('non-nullable swift cannot be null'); + } + $this->container['swift'] = $swift; + + return $this; + } + + /** + * Gets account_number + * + * @return string|null + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string|null $account_number account_number + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets phone + * + * @return string|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param string|null $phone phone + * + * @return self + */ + public function setPhone($phone) + { + if (is_null($phone)) { + throw new \InvalidArgumentException('non-nullable phone cannot be null'); + } + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets tax_type + * + * @return \Cone\Billingo\Model\PartnerTaxType|null + */ + public function getTaxType() + { + return $this->container['tax_type']; + } + + /** + * Sets tax_type + * + * @param \Cone\Billingo\Model\PartnerTaxType|null $tax_type tax_type + * + * @return self + */ + public function setTaxType($tax_type) + { + if (is_null($tax_type)) { + throw new \InvalidArgumentException('non-nullable tax_type cannot be null'); + } + $this->container['tax_type'] = $tax_type; + + return $this; + } + + /** + * Gets partner_shipping + * + * @return \Cone\Billingo\Model\DocumentPartnerPartnerShipping|null + */ + public function getPartnerShipping() + { + return $this->container['partner_shipping']; + } + + /** + * Sets partner_shipping + * + * @param \Cone\Billingo\Model\DocumentPartnerPartnerShipping|null $partner_shipping partner_shipping + * + * @return self + */ + public function setPartnerShipping($partner_shipping) + { + if (is_null($partner_shipping)) { + array_push($this->openAPINullablesSetToNull, 'partner_shipping'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('partner_shipping', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['partner_shipping'] = $partner_shipping; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentPartnerPartnerShipping.php b/lib/Model/DocumentPartnerPartnerShipping.php new file mode 100644 index 0000000..c57813c --- /dev/null +++ b/lib/Model/DocumentPartnerPartnerShipping.php @@ -0,0 +1,519 @@ + + */ +class DocumentPartnerPartnerShipping implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentPartner_partner_shipping'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'match' => 'bool', + 'name' => 'string', + 'mode' => '\Cone\Billingo\Model\ShippingMode', + 'address' => '\Cone\Billingo\Model\PartnerShippingAddress' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'match' => null, + 'name' => null, + 'mode' => null, + 'address' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'match' => false, + 'name' => false, + 'mode' => false, + 'address' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'match' => 'match', + 'name' => 'name', + 'mode' => 'mode', + 'address' => 'address' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'match' => 'setMatch', + 'name' => 'setName', + 'mode' => 'setMode', + 'address' => 'setAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'match' => 'getMatch', + 'name' => 'getName', + 'mode' => 'getMode', + 'address' => 'getAddress' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('match', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('mode', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets match + * + * @return bool|null + */ + public function getMatch() + { + return $this->container['match']; + } + + /** + * Sets match + * + * @param bool|null $match match + * + * @return self + */ + public function setMatch($match) + { + if (is_null($match)) { + throw new \InvalidArgumentException('non-nullable match cannot be null'); + } + $this->container['match'] = $match; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets mode + * + * @return \Cone\Billingo\Model\ShippingMode|null + */ + public function getMode() + { + return $this->container['mode']; + } + + /** + * Sets mode + * + * @param \Cone\Billingo\Model\ShippingMode|null $mode mode + * + * @return self + */ + public function setMode($mode) + { + if (is_null($mode)) { + throw new \InvalidArgumentException('non-nullable mode cannot be null'); + } + $this->container['mode'] = $mode; + + return $this; + } + + /** + * Gets address + * + * @return \Cone\Billingo\Model\PartnerShippingAddress|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Cone\Billingo\Model\PartnerShippingAddress|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + array_push($this->openAPINullablesSetToNull, 'address'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('address', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['address'] = $address; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentProductData.php b/lib/Model/DocumentProductData.php new file mode 100644 index 0000000..806304e --- /dev/null +++ b/lib/Model/DocumentProductData.php @@ -0,0 +1,700 @@ + + */ +class DocumentProductData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentProductData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'unit_price' => 'float', + 'unit_price_type' => '\Cone\Billingo\Model\UnitPriceType', + 'quantity' => 'float', + 'unit' => 'string', + 'vat' => '\Cone\Billingo\Model\Vat', + 'comment' => 'string', + 'entitlement' => '\Cone\Billingo\Model\Entitlement', + 'sku' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'unit_price' => 'float', + 'unit_price_type' => null, + 'quantity' => 'float', + 'unit' => null, + 'vat' => null, + 'comment' => null, + 'entitlement' => null, + 'sku' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'unit_price' => false, + 'unit_price_type' => false, + 'quantity' => false, + 'unit' => false, + 'vat' => false, + 'comment' => false, + 'entitlement' => false, + 'sku' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'unit_price' => 'unit_price', + 'unit_price_type' => 'unit_price_type', + 'quantity' => 'quantity', + 'unit' => 'unit', + 'vat' => 'vat', + 'comment' => 'comment', + 'entitlement' => 'entitlement', + 'sku' => 'sku' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'unit_price' => 'setUnitPrice', + 'unit_price_type' => 'setUnitPriceType', + 'quantity' => 'setQuantity', + 'unit' => 'setUnit', + 'vat' => 'setVat', + 'comment' => 'setComment', + 'entitlement' => 'setEntitlement', + 'sku' => 'setSku' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'unit_price' => 'getUnitPrice', + 'unit_price_type' => 'getUnitPriceType', + 'quantity' => 'getQuantity', + 'unit' => 'getUnit', + 'vat' => 'getVat', + 'comment' => 'getComment', + 'entitlement' => 'getEntitlement', + 'sku' => 'getSku' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('unit_price', $data ?? [], null); + $this->setIfExists('unit_price_type', $data ?? [], null); + $this->setIfExists('quantity', $data ?? [], null); + $this->setIfExists('unit', $data ?? [], null); + $this->setIfExists('vat', $data ?? [], null); + $this->setIfExists('comment', $data ?? [], null); + $this->setIfExists('entitlement', $data ?? [], null); + $this->setIfExists('sku', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['unit_price'] === null) { + $invalidProperties[] = "'unit_price' can't be null"; + } + if ($this->container['unit_price_type'] === null) { + $invalidProperties[] = "'unit_price_type' can't be null"; + } + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' can't be null"; + } + if ($this->container['unit'] === null) { + $invalidProperties[] = "'unit' can't be null"; + } + if ($this->container['vat'] === null) { + $invalidProperties[] = "'vat' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets unit_price + * + * @return float + */ + public function getUnitPrice() + { + return $this->container['unit_price']; + } + + /** + * Sets unit_price + * + * @param float $unit_price unit_price + * + * @return self + */ + public function setUnitPrice($unit_price) + { + if (is_null($unit_price)) { + throw new \InvalidArgumentException('non-nullable unit_price cannot be null'); + } + $this->container['unit_price'] = $unit_price; + + return $this; + } + + /** + * Gets unit_price_type + * + * @return \Cone\Billingo\Model\UnitPriceType + */ + public function getUnitPriceType() + { + return $this->container['unit_price_type']; + } + + /** + * Sets unit_price_type + * + * @param \Cone\Billingo\Model\UnitPriceType $unit_price_type unit_price_type + * + * @return self + */ + public function setUnitPriceType($unit_price_type) + { + if (is_null($unit_price_type)) { + throw new \InvalidArgumentException('non-nullable unit_price_type cannot be null'); + } + $this->container['unit_price_type'] = $unit_price_type; + + return $this; + } + + /** + * Gets quantity + * + * @return float + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param float $quantity quantity + * + * @return self + */ + public function setQuantity($quantity) + { + if (is_null($quantity)) { + throw new \InvalidArgumentException('non-nullable quantity cannot be null'); + } + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets unit + * + * @return string + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string $unit unit + * + * @return self + */ + public function setUnit($unit) + { + if (is_null($unit)) { + throw new \InvalidArgumentException('non-nullable unit cannot be null'); + } + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets vat + * + * @return \Cone\Billingo\Model\Vat + */ + public function getVat() + { + return $this->container['vat']; + } + + /** + * Sets vat + * + * @param \Cone\Billingo\Model\Vat $vat vat + * + * @return self + */ + public function setVat($vat) + { + if (is_null($vat)) { + throw new \InvalidArgumentException('non-nullable vat cannot be null'); + } + $this->container['vat'] = $vat; + + return $this; + } + + /** + * Gets comment + * + * @return string|null + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string|null $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + throw new \InvalidArgumentException('non-nullable comment cannot be null'); + } + $this->container['comment'] = $comment; + + return $this; + } + + /** + * Gets entitlement + * + * @return \Cone\Billingo\Model\Entitlement|null + */ + public function getEntitlement() + { + return $this->container['entitlement']; + } + + /** + * Sets entitlement + * + * @param \Cone\Billingo\Model\Entitlement|null $entitlement entitlement + * + * @return self + */ + public function setEntitlement($entitlement) + { + if (is_null($entitlement)) { + throw new \InvalidArgumentException('non-nullable entitlement cannot be null'); + } + $this->container['entitlement'] = $entitlement; + + return $this; + } + + /** + * Gets sku + * + * @return string|null + */ + public function getSku() + { + return $this->container['sku']; + } + + /** + * Sets sku + * + * @param string|null $sku sku + * + * @return self + */ + public function setSku($sku) + { + if (is_null($sku)) { + throw new \InvalidArgumentException('non-nullable sku cannot be null'); + } + $this->container['sku'] = $sku; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentPublicUrl.php b/lib/Model/DocumentPublicUrl.php new file mode 100644 index 0000000..70ddd4c --- /dev/null +++ b/lib/Model/DocumentPublicUrl.php @@ -0,0 +1,410 @@ + + */ +class DocumentPublicUrl implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentPublicUrl'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'public_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'public_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'public_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'public_url' => 'public_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'public_url' => 'setPublicUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'public_url' => 'getPublicUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('public_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets public_url + * + * @return string|null + */ + public function getPublicUrl() + { + return $this->container['public_url']; + } + + /** + * Sets public_url + * + * @param string|null $public_url public_url + * + * @return self + */ + public function setPublicUrl($public_url) + { + if (is_null($public_url)) { + throw new \InvalidArgumentException('non-nullable public_url cannot be null'); + } + $this->container['public_url'] = $public_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentSettings.php b/lib/Model/DocumentSettings.php new file mode 100644 index 0000000..b3c2b15 --- /dev/null +++ b/lib/Model/DocumentSettings.php @@ -0,0 +1,807 @@ + + */ +class DocumentSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'mediated_service' => 'bool', + 'without_financial_fulfillment' => 'bool', + 'online_payment' => '\Cone\Billingo\Model\OnlinePayment', + 'should_send_email' => 'bool', + 'round' => '\Cone\Billingo\Model\Round', + 'no_send_onlineszamla_by_user' => 'bool', + 'dont_send_to_nav_reason' => '\Cone\Billingo\Model\DocumentSettingsDontSendToNavReason', + 'order_number' => 'string', + 'place_id' => 'int', + 'instant_payment' => 'bool', + 'selected_type' => '\Cone\Billingo\Model\DocumentType', + 'instant_payment_request' => '\Cone\Billingo\Model\DocumentInsertInstantPaymentRequest' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'mediated_service' => null, + 'without_financial_fulfillment' => null, + 'online_payment' => null, + 'should_send_email' => null, + 'round' => null, + 'no_send_onlineszamla_by_user' => null, + 'dont_send_to_nav_reason' => null, + 'order_number' => null, + 'place_id' => null, + 'instant_payment' => null, + 'selected_type' => null, + 'instant_payment_request' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'mediated_service' => false, + 'without_financial_fulfillment' => false, + 'online_payment' => false, + 'should_send_email' => false, + 'round' => false, + 'no_send_onlineszamla_by_user' => false, + 'dont_send_to_nav_reason' => true, + 'order_number' => false, + 'place_id' => true, + 'instant_payment' => false, + 'selected_type' => false, + 'instant_payment_request' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'mediated_service' => 'mediated_service', + 'without_financial_fulfillment' => 'without_financial_fulfillment', + 'online_payment' => 'online_payment', + 'should_send_email' => 'should_send_email', + 'round' => 'round', + 'no_send_onlineszamla_by_user' => 'no_send_onlineszamla_by_user', + 'dont_send_to_nav_reason' => 'dont_send_to_nav_reason', + 'order_number' => 'order_number', + 'place_id' => 'place_id', + 'instant_payment' => 'instant_payment', + 'selected_type' => 'selected_type', + 'instant_payment_request' => 'instant_payment_request' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'mediated_service' => 'setMediatedService', + 'without_financial_fulfillment' => 'setWithoutFinancialFulfillment', + 'online_payment' => 'setOnlinePayment', + 'should_send_email' => 'setShouldSendEmail', + 'round' => 'setRound', + 'no_send_onlineszamla_by_user' => 'setNoSendOnlineszamlaByUser', + 'dont_send_to_nav_reason' => 'setDontSendToNavReason', + 'order_number' => 'setOrderNumber', + 'place_id' => 'setPlaceId', + 'instant_payment' => 'setInstantPayment', + 'selected_type' => 'setSelectedType', + 'instant_payment_request' => 'setInstantPaymentRequest' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'mediated_service' => 'getMediatedService', + 'without_financial_fulfillment' => 'getWithoutFinancialFulfillment', + 'online_payment' => 'getOnlinePayment', + 'should_send_email' => 'getShouldSendEmail', + 'round' => 'getRound', + 'no_send_onlineszamla_by_user' => 'getNoSendOnlineszamlaByUser', + 'dont_send_to_nav_reason' => 'getDontSendToNavReason', + 'order_number' => 'getOrderNumber', + 'place_id' => 'getPlaceId', + 'instant_payment' => 'getInstantPayment', + 'selected_type' => 'getSelectedType', + 'instant_payment_request' => 'getInstantPaymentRequest' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('mediated_service', $data ?? [], false); + $this->setIfExists('without_financial_fulfillment', $data ?? [], false); + $this->setIfExists('online_payment', $data ?? [], null); + $this->setIfExists('should_send_email', $data ?? [], false); + $this->setIfExists('round', $data ?? [], null); + $this->setIfExists('no_send_onlineszamla_by_user', $data ?? [], null); + $this->setIfExists('dont_send_to_nav_reason', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('place_id', $data ?? [], null); + $this->setIfExists('instant_payment', $data ?? [], null); + $this->setIfExists('selected_type', $data ?? [], null); + $this->setIfExists('instant_payment_request', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets mediated_service + * + * @return bool|null + */ + public function getMediatedService() + { + return $this->container['mediated_service']; + } + + /** + * Sets mediated_service + * + * @param bool|null $mediated_service mediated_service + * + * @return self + */ + public function setMediatedService($mediated_service) + { + if (is_null($mediated_service)) { + throw new \InvalidArgumentException('non-nullable mediated_service cannot be null'); + } + $this->container['mediated_service'] = $mediated_service; + + return $this; + } + + /** + * Gets without_financial_fulfillment + * + * @return bool|null + */ + public function getWithoutFinancialFulfillment() + { + return $this->container['without_financial_fulfillment']; + } + + /** + * Sets without_financial_fulfillment + * + * @param bool|null $without_financial_fulfillment without_financial_fulfillment + * + * @return self + */ + public function setWithoutFinancialFulfillment($without_financial_fulfillment) + { + if (is_null($without_financial_fulfillment)) { + throw new \InvalidArgumentException('non-nullable without_financial_fulfillment cannot be null'); + } + $this->container['without_financial_fulfillment'] = $without_financial_fulfillment; + + return $this; + } + + /** + * Gets online_payment + * + * @return \Cone\Billingo\Model\OnlinePayment|null + */ + public function getOnlinePayment() + { + return $this->container['online_payment']; + } + + /** + * Sets online_payment + * + * @param \Cone\Billingo\Model\OnlinePayment|null $online_payment online_payment + * + * @return self + */ + public function setOnlinePayment($online_payment) + { + if (is_null($online_payment)) { + throw new \InvalidArgumentException('non-nullable online_payment cannot be null'); + } + $this->container['online_payment'] = $online_payment; + + return $this; + } + + /** + * Gets should_send_email + * + * @return bool|null + */ + public function getShouldSendEmail() + { + return $this->container['should_send_email']; + } + + /** + * Sets should_send_email + * + * @param bool|null $should_send_email should_send_email + * + * @return self + */ + public function setShouldSendEmail($should_send_email) + { + if (is_null($should_send_email)) { + throw new \InvalidArgumentException('non-nullable should_send_email cannot be null'); + } + $this->container['should_send_email'] = $should_send_email; + + return $this; + } + + /** + * Gets round + * + * @return \Cone\Billingo\Model\Round|null + */ + public function getRound() + { + return $this->container['round']; + } + + /** + * Sets round + * + * @param \Cone\Billingo\Model\Round|null $round round + * + * @return self + */ + public function setRound($round) + { + if (is_null($round)) { + throw new \InvalidArgumentException('non-nullable round cannot be null'); + } + $this->container['round'] = $round; + + return $this; + } + + /** + * Gets no_send_onlineszamla_by_user + * + * @return bool|null + * @deprecated + */ + public function getNoSendOnlineszamlaByUser() + { + return $this->container['no_send_onlineszamla_by_user']; + } + + /** + * Sets no_send_onlineszamla_by_user + * + * @param bool|null $no_send_onlineszamla_by_user no_send_onlineszamla_by_user + * + * @return self + * @deprecated + */ + public function setNoSendOnlineszamlaByUser($no_send_onlineszamla_by_user) + { + if (is_null($no_send_onlineszamla_by_user)) { + throw new \InvalidArgumentException('non-nullable no_send_onlineszamla_by_user cannot be null'); + } + $this->container['no_send_onlineszamla_by_user'] = $no_send_onlineszamla_by_user; + + return $this; + } + + /** + * Gets dont_send_to_nav_reason + * + * @return \Cone\Billingo\Model\DocumentSettingsDontSendToNavReason|null + */ + public function getDontSendToNavReason() + { + return $this->container['dont_send_to_nav_reason']; + } + + /** + * Sets dont_send_to_nav_reason + * + * @param \Cone\Billingo\Model\DocumentSettingsDontSendToNavReason|null $dont_send_to_nav_reason dont_send_to_nav_reason + * + * @return self + */ + public function setDontSendToNavReason($dont_send_to_nav_reason) + { + if (is_null($dont_send_to_nav_reason)) { + array_push($this->openAPINullablesSetToNull, 'dont_send_to_nav_reason'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('dont_send_to_nav_reason', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['dont_send_to_nav_reason'] = $dont_send_to_nav_reason; + + return $this; + } + + /** + * Gets order_number + * + * @return string|null + */ + public function getOrderNumber() + { + return $this->container['order_number']; + } + + /** + * Sets order_number + * + * @param string|null $order_number order_number + * + * @return self + */ + public function setOrderNumber($order_number) + { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } + $this->container['order_number'] = $order_number; + + return $this; + } + + /** + * Gets place_id + * + * @return int|null + */ + public function getPlaceId() + { + return $this->container['place_id']; + } + + /** + * Sets place_id + * + * @param int|null $place_id place_id + * + * @return self + */ + public function setPlaceId($place_id) + { + if (is_null($place_id)) { + array_push($this->openAPINullablesSetToNull, 'place_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('place_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['place_id'] = $place_id; + + return $this; + } + + /** + * Gets instant_payment + * + * @return bool|null + */ + public function getInstantPayment() + { + return $this->container['instant_payment']; + } + + /** + * Sets instant_payment + * + * @param bool|null $instant_payment instant_payment + * + * @return self + */ + public function setInstantPayment($instant_payment) + { + if (is_null($instant_payment)) { + throw new \InvalidArgumentException('non-nullable instant_payment cannot be null'); + } + $this->container['instant_payment'] = $instant_payment; + + return $this; + } + + /** + * Gets selected_type + * + * @return \Cone\Billingo\Model\DocumentType|null + */ + public function getSelectedType() + { + return $this->container['selected_type']; + } + + /** + * Sets selected_type + * + * @param \Cone\Billingo\Model\DocumentType|null $selected_type selected_type + * + * @return self + */ + public function setSelectedType($selected_type) + { + if (is_null($selected_type)) { + throw new \InvalidArgumentException('non-nullable selected_type cannot be null'); + } + $this->container['selected_type'] = $selected_type; + + return $this; + } + + /** + * Gets instant_payment_request + * + * @return \Cone\Billingo\Model\DocumentInsertInstantPaymentRequest|null + */ + public function getInstantPaymentRequest() + { + return $this->container['instant_payment_request']; + } + + /** + * Sets instant_payment_request + * + * @param \Cone\Billingo\Model\DocumentInsertInstantPaymentRequest|null $instant_payment_request instant_payment_request + * + * @return self + */ + public function setInstantPaymentRequest($instant_payment_request) + { + if (is_null($instant_payment_request)) { + array_push($this->openAPINullablesSetToNull, 'instant_payment_request'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('instant_payment_request', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['instant_payment_request'] = $instant_payment_request; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentSettingsDontSendToNavReason.php b/lib/Model/DocumentSettingsDontSendToNavReason.php new file mode 100644 index 0000000..30c2c54 --- /dev/null +++ b/lib/Model/DocumentSettingsDontSendToNavReason.php @@ -0,0 +1,382 @@ + + */ +class DocumentSettingsDontSendToNavReason implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentSettings_dont_send_to_nav_reason'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentSummary.php b/lib/Model/DocumentSummary.php new file mode 100644 index 0000000..a505716 --- /dev/null +++ b/lib/Model/DocumentSummary.php @@ -0,0 +1,580 @@ + + */ +class DocumentSummary implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentSummary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'net_amount' => 'float', + 'net_amount_local' => 'float', + 'gross_amount_local' => 'float', + 'vat_amount' => 'float', + 'vat_amount_local' => 'float', + 'vat_rate_summary' => '\Cone\Billingo\Model\DocumentVatRateSummary[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'net_amount' => 'float', + 'net_amount_local' => 'float', + 'gross_amount_local' => 'float', + 'vat_amount' => 'float', + 'vat_amount_local' => 'float', + 'vat_rate_summary' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'net_amount' => false, + 'net_amount_local' => false, + 'gross_amount_local' => false, + 'vat_amount' => false, + 'vat_amount_local' => false, + 'vat_rate_summary' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'net_amount' => 'net_amount', + 'net_amount_local' => 'net_amount_local', + 'gross_amount_local' => 'gross_amount_local', + 'vat_amount' => 'vat_amount', + 'vat_amount_local' => 'vat_amount_local', + 'vat_rate_summary' => 'vat_rate_summary' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'net_amount' => 'setNetAmount', + 'net_amount_local' => 'setNetAmountLocal', + 'gross_amount_local' => 'setGrossAmountLocal', + 'vat_amount' => 'setVatAmount', + 'vat_amount_local' => 'setVatAmountLocal', + 'vat_rate_summary' => 'setVatRateSummary' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'net_amount' => 'getNetAmount', + 'net_amount_local' => 'getNetAmountLocal', + 'gross_amount_local' => 'getGrossAmountLocal', + 'vat_amount' => 'getVatAmount', + 'vat_amount_local' => 'getVatAmountLocal', + 'vat_rate_summary' => 'getVatRateSummary' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('net_amount', $data ?? [], null); + $this->setIfExists('net_amount_local', $data ?? [], null); + $this->setIfExists('gross_amount_local', $data ?? [], null); + $this->setIfExists('vat_amount', $data ?? [], null); + $this->setIfExists('vat_amount_local', $data ?? [], null); + $this->setIfExists('vat_rate_summary', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets net_amount + * + * @return float|null + */ + public function getNetAmount() + { + return $this->container['net_amount']; + } + + /** + * Sets net_amount + * + * @param float|null $net_amount net_amount + * + * @return self + */ + public function setNetAmount($net_amount) + { + if (is_null($net_amount)) { + throw new \InvalidArgumentException('non-nullable net_amount cannot be null'); + } + $this->container['net_amount'] = $net_amount; + + return $this; + } + + /** + * Gets net_amount_local + * + * @return float|null + */ + public function getNetAmountLocal() + { + return $this->container['net_amount_local']; + } + + /** + * Sets net_amount_local + * + * @param float|null $net_amount_local net_amount_local + * + * @return self + */ + public function setNetAmountLocal($net_amount_local) + { + if (is_null($net_amount_local)) { + throw new \InvalidArgumentException('non-nullable net_amount_local cannot be null'); + } + $this->container['net_amount_local'] = $net_amount_local; + + return $this; + } + + /** + * Gets gross_amount_local + * + * @return float|null + */ + public function getGrossAmountLocal() + { + return $this->container['gross_amount_local']; + } + + /** + * Sets gross_amount_local + * + * @param float|null $gross_amount_local gross_amount_local + * + * @return self + */ + public function setGrossAmountLocal($gross_amount_local) + { + if (is_null($gross_amount_local)) { + throw new \InvalidArgumentException('non-nullable gross_amount_local cannot be null'); + } + $this->container['gross_amount_local'] = $gross_amount_local; + + return $this; + } + + /** + * Gets vat_amount + * + * @return float|null + */ + public function getVatAmount() + { + return $this->container['vat_amount']; + } + + /** + * Sets vat_amount + * + * @param float|null $vat_amount vat_amount + * + * @return self + */ + public function setVatAmount($vat_amount) + { + if (is_null($vat_amount)) { + throw new \InvalidArgumentException('non-nullable vat_amount cannot be null'); + } + $this->container['vat_amount'] = $vat_amount; + + return $this; + } + + /** + * Gets vat_amount_local + * + * @return float|null + */ + public function getVatAmountLocal() + { + return $this->container['vat_amount_local']; + } + + /** + * Sets vat_amount_local + * + * @param float|null $vat_amount_local vat_amount_local + * + * @return self + */ + public function setVatAmountLocal($vat_amount_local) + { + if (is_null($vat_amount_local)) { + throw new \InvalidArgumentException('non-nullable vat_amount_local cannot be null'); + } + $this->container['vat_amount_local'] = $vat_amount_local; + + return $this; + } + + /** + * Gets vat_rate_summary + * + * @return \Cone\Billingo\Model\DocumentVatRateSummary[]|null + */ + public function getVatRateSummary() + { + return $this->container['vat_rate_summary']; + } + + /** + * Sets vat_rate_summary + * + * @param \Cone\Billingo\Model\DocumentVatRateSummary[]|null $vat_rate_summary vat_rate_summary + * + * @return self + */ + public function setVatRateSummary($vat_rate_summary) + { + if (is_null($vat_rate_summary)) { + throw new \InvalidArgumentException('non-nullable vat_rate_summary cannot be null'); + } + $this->container['vat_rate_summary'] = $vat_rate_summary; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DocumentType.php b/lib/Model/DocumentType.php new file mode 100644 index 0000000..f05bf08 --- /dev/null +++ b/lib/Model/DocumentType.php @@ -0,0 +1,108 @@ + + */ +class DocumentVatRateSummary implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentVatRateSummary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'vat_name' => 'string', + 'vat_percentage' => 'float', + 'vat_rate_net_amount' => 'float', + 'vat_rate_vat_amount' => 'float', + 'vat_rate_vat_amount_local' => 'float', + 'vat_rate_gross_amount' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'vat_name' => null, + 'vat_percentage' => 'float', + 'vat_rate_net_amount' => 'float', + 'vat_rate_vat_amount' => 'float', + 'vat_rate_vat_amount_local' => 'float', + 'vat_rate_gross_amount' => 'float' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'vat_name' => false, + 'vat_percentage' => false, + 'vat_rate_net_amount' => false, + 'vat_rate_vat_amount' => false, + 'vat_rate_vat_amount_local' => false, + 'vat_rate_gross_amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'vat_name' => 'vat_name', + 'vat_percentage' => 'vat_percentage', + 'vat_rate_net_amount' => 'vat_rate_net_amount', + 'vat_rate_vat_amount' => 'vat_rate_vat_amount', + 'vat_rate_vat_amount_local' => 'vat_rate_vat_amount_local', + 'vat_rate_gross_amount' => 'vat_rate_gross_amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'vat_name' => 'setVatName', + 'vat_percentage' => 'setVatPercentage', + 'vat_rate_net_amount' => 'setVatRateNetAmount', + 'vat_rate_vat_amount' => 'setVatRateVatAmount', + 'vat_rate_vat_amount_local' => 'setVatRateVatAmountLocal', + 'vat_rate_gross_amount' => 'setVatRateGrossAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'vat_name' => 'getVatName', + 'vat_percentage' => 'getVatPercentage', + 'vat_rate_net_amount' => 'getVatRateNetAmount', + 'vat_rate_vat_amount' => 'getVatRateVatAmount', + 'vat_rate_vat_amount_local' => 'getVatRateVatAmountLocal', + 'vat_rate_gross_amount' => 'getVatRateGrossAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('vat_name', $data ?? [], null); + $this->setIfExists('vat_percentage', $data ?? [], null); + $this->setIfExists('vat_rate_net_amount', $data ?? [], null); + $this->setIfExists('vat_rate_vat_amount', $data ?? [], null); + $this->setIfExists('vat_rate_vat_amount_local', $data ?? [], null); + $this->setIfExists('vat_rate_gross_amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets vat_name + * + * @return string|null + */ + public function getVatName() + { + return $this->container['vat_name']; + } + + /** + * Sets vat_name + * + * @param string|null $vat_name vat_name + * + * @return self + */ + public function setVatName($vat_name) + { + if (is_null($vat_name)) { + throw new \InvalidArgumentException('non-nullable vat_name cannot be null'); + } + $this->container['vat_name'] = $vat_name; + + return $this; + } + + /** + * Gets vat_percentage + * + * @return float|null + */ + public function getVatPercentage() + { + return $this->container['vat_percentage']; + } + + /** + * Sets vat_percentage + * + * @param float|null $vat_percentage vat_percentage + * + * @return self + */ + public function setVatPercentage($vat_percentage) + { + if (is_null($vat_percentage)) { + throw new \InvalidArgumentException('non-nullable vat_percentage cannot be null'); + } + $this->container['vat_percentage'] = $vat_percentage; + + return $this; + } + + /** + * Gets vat_rate_net_amount + * + * @return float|null + */ + public function getVatRateNetAmount() + { + return $this->container['vat_rate_net_amount']; + } + + /** + * Sets vat_rate_net_amount + * + * @param float|null $vat_rate_net_amount vat_rate_net_amount + * + * @return self + */ + public function setVatRateNetAmount($vat_rate_net_amount) + { + if (is_null($vat_rate_net_amount)) { + throw new \InvalidArgumentException('non-nullable vat_rate_net_amount cannot be null'); + } + $this->container['vat_rate_net_amount'] = $vat_rate_net_amount; + + return $this; + } + + /** + * Gets vat_rate_vat_amount + * + * @return float|null + */ + public function getVatRateVatAmount() + { + return $this->container['vat_rate_vat_amount']; + } + + /** + * Sets vat_rate_vat_amount + * + * @param float|null $vat_rate_vat_amount vat_rate_vat_amount + * + * @return self + */ + public function setVatRateVatAmount($vat_rate_vat_amount) + { + if (is_null($vat_rate_vat_amount)) { + throw new \InvalidArgumentException('non-nullable vat_rate_vat_amount cannot be null'); + } + $this->container['vat_rate_vat_amount'] = $vat_rate_vat_amount; + + return $this; + } + + /** + * Gets vat_rate_vat_amount_local + * + * @return float|null + */ + public function getVatRateVatAmountLocal() + { + return $this->container['vat_rate_vat_amount_local']; + } + + /** + * Sets vat_rate_vat_amount_local + * + * @param float|null $vat_rate_vat_amount_local vat_rate_vat_amount_local + * + * @return self + */ + public function setVatRateVatAmountLocal($vat_rate_vat_amount_local) + { + if (is_null($vat_rate_vat_amount_local)) { + throw new \InvalidArgumentException('non-nullable vat_rate_vat_amount_local cannot be null'); + } + $this->container['vat_rate_vat_amount_local'] = $vat_rate_vat_amount_local; + + return $this; + } + + /** + * Gets vat_rate_gross_amount + * + * @return float|null + */ + public function getVatRateGrossAmount() + { + return $this->container['vat_rate_gross_amount']; + } + + /** + * Sets vat_rate_gross_amount + * + * @param float|null $vat_rate_gross_amount vat_rate_gross_amount + * + * @return self + */ + public function setVatRateGrossAmount($vat_rate_gross_amount) + { + if (is_null($vat_rate_gross_amount)) { + throw new \InvalidArgumentException('non-nullable vat_rate_gross_amount cannot be null'); + } + $this->container['vat_rate_gross_amount'] = $vat_rate_gross_amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DontSendToNavReason.php b/lib/Model/DontSendToNavReason.php new file mode 100644 index 0000000..524e13d --- /dev/null +++ b/lib/Model/DontSendToNavReason.php @@ -0,0 +1,66 @@ + + */ +class Id implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Id'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'legacy_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'legacy_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'legacy_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'legacy_id' => 'legacy_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'legacy_id' => 'setLegacyId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'legacy_id' => 'getLegacyId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('legacy_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets legacy_id + * + * @return int|null + */ + public function getLegacyId() + { + return $this->container['legacy_id']; + } + + /** + * Sets legacy_id + * + * @param int|null $legacy_id legacy_id + * + * @return self + */ + public function setLegacyId($legacy_id) + { + if (is_null($legacy_id)) { + throw new \InvalidArgumentException('non-nullable legacy_id cannot be null'); + } + $this->container['legacy_id'] = $legacy_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/InvoiceSettings.php b/lib/Model/InvoiceSettings.php new file mode 100644 index 0000000..3c34c71 --- /dev/null +++ b/lib/Model/InvoiceSettings.php @@ -0,0 +1,546 @@ + + */ +class InvoiceSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InvoiceSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'document_type' => '\Cone\Billingo\Model\DocumentType', + 'fulfillment_date' => '\DateTime', + 'due_date' => '\DateTime', + 'document_format' => '\Cone\Billingo\Model\DocumentFormat', + 'comment' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'document_type' => null, + 'fulfillment_date' => 'date', + 'due_date' => 'date', + 'document_format' => null, + 'comment' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'document_type' => false, + 'fulfillment_date' => false, + 'due_date' => false, + 'document_format' => false, + 'comment' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'document_type' => 'document_type', + 'fulfillment_date' => 'fulfillment_date', + 'due_date' => 'due_date', + 'document_format' => 'document_format', + 'comment' => 'comment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'document_type' => 'setDocumentType', + 'fulfillment_date' => 'setFulfillmentDate', + 'due_date' => 'setDueDate', + 'document_format' => 'setDocumentFormat', + 'comment' => 'setComment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'document_type' => 'getDocumentType', + 'fulfillment_date' => 'getFulfillmentDate', + 'due_date' => 'getDueDate', + 'document_format' => 'getDocumentFormat', + 'comment' => 'getComment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('document_type', $data ?? [], null); + $this->setIfExists('fulfillment_date', $data ?? [], null); + $this->setIfExists('due_date', $data ?? [], null); + $this->setIfExists('document_format', $data ?? [], null); + $this->setIfExists('comment', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets document_type + * + * @return \Cone\Billingo\Model\DocumentType|null + */ + public function getDocumentType() + { + return $this->container['document_type']; + } + + /** + * Sets document_type + * + * @param \Cone\Billingo\Model\DocumentType|null $document_type document_type + * + * @return self + */ + public function setDocumentType($document_type) + { + if (is_null($document_type)) { + throw new \InvalidArgumentException('non-nullable document_type cannot be null'); + } + $this->container['document_type'] = $document_type; + + return $this; + } + + /** + * Gets fulfillment_date + * + * @return \DateTime|null + */ + public function getFulfillmentDate() + { + return $this->container['fulfillment_date']; + } + + /** + * Sets fulfillment_date + * + * @param \DateTime|null $fulfillment_date fulfillment_date + * + * @return self + */ + public function setFulfillmentDate($fulfillment_date) + { + if (is_null($fulfillment_date)) { + throw new \InvalidArgumentException('non-nullable fulfillment_date cannot be null'); + } + $this->container['fulfillment_date'] = $fulfillment_date; + + return $this; + } + + /** + * Gets due_date + * + * @return \DateTime|null + */ + public function getDueDate() + { + return $this->container['due_date']; + } + + /** + * Sets due_date + * + * @param \DateTime|null $due_date due_date + * + * @return self + */ + public function setDueDate($due_date) + { + if (is_null($due_date)) { + throw new \InvalidArgumentException('non-nullable due_date cannot be null'); + } + $this->container['due_date'] = $due_date; + + return $this; + } + + /** + * Gets document_format + * + * @return \Cone\Billingo\Model\DocumentFormat|null + */ + public function getDocumentFormat() + { + return $this->container['document_format']; + } + + /** + * Sets document_format + * + * @param \Cone\Billingo\Model\DocumentFormat|null $document_format document_format + * + * @return self + */ + public function setDocumentFormat($document_format) + { + if (is_null($document_format)) { + throw new \InvalidArgumentException('non-nullable document_format cannot be null'); + } + $this->container['document_format'] = $document_format; + + return $this; + } + + /** + * Gets comment + * + * @return string|null + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string|null $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + throw new \InvalidArgumentException('non-nullable comment cannot be null'); + } + $this->container['comment'] = $comment; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/LedgerNumberInformation.php b/lib/Model/LedgerNumberInformation.php new file mode 100644 index 0000000..de7685a --- /dev/null +++ b/lib/Model/LedgerNumberInformation.php @@ -0,0 +1,512 @@ + + */ +class LedgerNumberInformation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LedgerNumberInformation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bevetel' => 'string', + 'vevo' => 'string', + 'penztar' => 'string', + 'afa' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bevetel' => null, + 'vevo' => null, + 'penztar' => null, + 'afa' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'bevetel' => false, + 'vevo' => false, + 'penztar' => false, + 'afa' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'bevetel' => 'bevetel', + 'vevo' => 'vevo', + 'penztar' => 'penztar', + 'afa' => 'afa' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bevetel' => 'setBevetel', + 'vevo' => 'setVevo', + 'penztar' => 'setPenztar', + 'afa' => 'setAfa' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bevetel' => 'getBevetel', + 'vevo' => 'getVevo', + 'penztar' => 'getPenztar', + 'afa' => 'getAfa' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('bevetel', $data ?? [], null); + $this->setIfExists('vevo', $data ?? [], null); + $this->setIfExists('penztar', $data ?? [], null); + $this->setIfExists('afa', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets bevetel + * + * @return string|null + */ + public function getBevetel() + { + return $this->container['bevetel']; + } + + /** + * Sets bevetel + * + * @param string|null $bevetel bevetel + * + * @return self + */ + public function setBevetel($bevetel) + { + if (is_null($bevetel)) { + throw new \InvalidArgumentException('non-nullable bevetel cannot be null'); + } + $this->container['bevetel'] = $bevetel; + + return $this; + } + + /** + * Gets vevo + * + * @return string|null + */ + public function getVevo() + { + return $this->container['vevo']; + } + + /** + * Sets vevo + * + * @param string|null $vevo vevo + * + * @return self + */ + public function setVevo($vevo) + { + if (is_null($vevo)) { + throw new \InvalidArgumentException('non-nullable vevo cannot be null'); + } + $this->container['vevo'] = $vevo; + + return $this; + } + + /** + * Gets penztar + * + * @return string|null + */ + public function getPenztar() + { + return $this->container['penztar']; + } + + /** + * Sets penztar + * + * @param string|null $penztar penztar + * + * @return self + */ + public function setPenztar($penztar) + { + if (is_null($penztar)) { + throw new \InvalidArgumentException('non-nullable penztar cannot be null'); + } + $this->container['penztar'] = $penztar; + + return $this; + } + + /** + * Gets afa + * + * @return string|null + */ + public function getAfa() + { + return $this->container['afa']; + } + + /** + * Sets afa + * + * @param string|null $afa afa + * + * @return self + */ + public function setAfa($afa) + { + if (is_null($afa)) { + throw new \InvalidArgumentException('non-nullable afa cannot be null'); + } + $this->container['afa'] = $afa; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php new file mode 100644 index 0000000..990b2f6 --- /dev/null +++ b/lib/Model/ModelInterface.php @@ -0,0 +1,112 @@ + + */ +class ModificationDocumentInsert implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ModificationDocumentInsert'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'due_date' => '\DateTime', + 'comment' => 'string', + 'payment_method' => '\Cone\Billingo\Model\PaymentMethod', + 'without_financial_fulfillment' => 'bool', + 'items' => '\Cone\Billingo\Model\DocumentInsertItemsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'due_date' => 'date', + 'comment' => null, + 'payment_method' => null, + 'without_financial_fulfillment' => null, + 'items' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'due_date' => false, + 'comment' => false, + 'payment_method' => false, + 'without_financial_fulfillment' => false, + 'items' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'due_date' => 'due_date', + 'comment' => 'comment', + 'payment_method' => 'payment_method', + 'without_financial_fulfillment' => 'without_financial_fulfillment', + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'due_date' => 'setDueDate', + 'comment' => 'setComment', + 'payment_method' => 'setPaymentMethod', + 'without_financial_fulfillment' => 'setWithoutFinancialFulfillment', + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'due_date' => 'getDueDate', + 'comment' => 'getComment', + 'payment_method' => 'getPaymentMethod', + 'without_financial_fulfillment' => 'getWithoutFinancialFulfillment', + 'items' => 'getItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('due_date', $data ?? [], null); + $this->setIfExists('comment', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('without_financial_fulfillment', $data ?? [], false); + $this->setIfExists('items', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets due_date + * + * @return \DateTime|null + */ + public function getDueDate() + { + return $this->container['due_date']; + } + + /** + * Sets due_date + * + * @param \DateTime|null $due_date due_date + * + * @return self + */ + public function setDueDate($due_date) + { + if (is_null($due_date)) { + throw new \InvalidArgumentException('non-nullable due_date cannot be null'); + } + $this->container['due_date'] = $due_date; + + return $this; + } + + /** + * Gets comment + * + * @return string|null + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string|null $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + throw new \InvalidArgumentException('non-nullable comment cannot be null'); + } + $this->container['comment'] = $comment; + + return $this; + } + + /** + * Gets payment_method + * + * @return \Cone\Billingo\Model\PaymentMethod|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Cone\Billingo\Model\PaymentMethod|null $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets without_financial_fulfillment + * + * @return bool|null + */ + public function getWithoutFinancialFulfillment() + { + return $this->container['without_financial_fulfillment']; + } + + /** + * Sets without_financial_fulfillment + * + * @param bool|null $without_financial_fulfillment without_financial_fulfillment + * + * @return self + */ + public function setWithoutFinancialFulfillment($without_financial_fulfillment) + { + if (is_null($without_financial_fulfillment)) { + throw new \InvalidArgumentException('non-nullable without_financial_fulfillment cannot be null'); + } + $this->container['without_financial_fulfillment'] = $without_financial_fulfillment; + + return $this; + } + + /** + * Gets items + * + * @return \Cone\Billingo\Model\DocumentInsertItemsInner[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Cone\Billingo\Model\DocumentInsertItemsInner[]|null $items items + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + $this->container['items'] = $items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Money.php b/lib/Model/Money.php new file mode 100644 index 0000000..e25f7d1 --- /dev/null +++ b/lib/Model/Money.php @@ -0,0 +1,444 @@ + + */ +class Money implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Money'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'amount' => 'float', + 'currency' => '\Cone\Billingo\Model\Currency' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'amount' => 'float', + 'currency' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'amount' => false, + 'currency' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'currency' => 'currency' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'currency' => 'setCurrency' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'currency' => 'getCurrency' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return float|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param float|null $amount amount + * + * @return self + */ + public function setAmount($amount) + { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets currency + * + * @return \Cone\Billingo\Model\Currency|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param \Cone\Billingo\Model\Currency|null $currency currency + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/OnlinePayment.php b/lib/Model/OnlinePayment.php new file mode 100644 index 0000000..71f27dd --- /dev/null +++ b/lib/Model/OnlinePayment.php @@ -0,0 +1,69 @@ + + */ +class OnlineSzamlaStatus implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OnlineSzamlaStatus'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'transaction_id' => 'string', + 'status' => 'string', + 'messages' => '\Cone\Billingo\Model\OnlineSzamlaStatusMessage[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'transaction_id' => null, + 'status' => null, + 'messages' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'transaction_id' => false, + 'status' => false, + 'messages' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'transaction_id' => 'transaction_id', + 'status' => 'status', + 'messages' => 'messages' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transaction_id' => 'setTransactionId', + 'status' => 'setStatus', + 'messages' => 'setMessages' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transaction_id' => 'getTransactionId', + 'status' => 'getStatus', + 'messages' => 'getMessages' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('transaction_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('messages', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets transaction_id + * + * @return string|null + */ + public function getTransactionId() + { + return $this->container['transaction_id']; + } + + /** + * Sets transaction_id + * + * @param string|null $transaction_id transaction_id + * + * @return self + */ + public function setTransactionId($transaction_id) + { + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('non-nullable transaction_id cannot be null'); + } + $this->container['transaction_id'] = $transaction_id; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets messages + * + * @return \Cone\Billingo\Model\OnlineSzamlaStatusMessage[]|null + */ + public function getMessages() + { + return $this->container['messages']; + } + + /** + * Sets messages + * + * @param \Cone\Billingo\Model\OnlineSzamlaStatusMessage[]|null $messages messages + * + * @return self + */ + public function setMessages($messages) + { + if (is_null($messages)) { + throw new \InvalidArgumentException('non-nullable messages cannot be null'); + } + $this->container['messages'] = $messages; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/OnlineSzamlaStatusEnum.php b/lib/Model/OnlineSzamlaStatusEnum.php new file mode 100644 index 0000000..316d17c --- /dev/null +++ b/lib/Model/OnlineSzamlaStatusEnum.php @@ -0,0 +1,186 @@ + + */ +class OnlineSzamlaStatusMessage implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OnlineSzamlaStatusMessage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'validation_result_code' => 'string', + 'validation_error_code' => 'string', + 'human_readable_message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'validation_result_code' => null, + 'validation_error_code' => null, + 'human_readable_message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'validation_result_code' => false, + 'validation_error_code' => false, + 'human_readable_message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'validation_result_code' => 'validation_result_code', + 'validation_error_code' => 'validation_error_code', + 'human_readable_message' => 'human_readable_message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'validation_result_code' => 'setValidationResultCode', + 'validation_error_code' => 'setValidationErrorCode', + 'human_readable_message' => 'setHumanReadableMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'validation_result_code' => 'getValidationResultCode', + 'validation_error_code' => 'getValidationErrorCode', + 'human_readable_message' => 'getHumanReadableMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('validation_result_code', $data ?? [], null); + $this->setIfExists('validation_error_code', $data ?? [], null); + $this->setIfExists('human_readable_message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets validation_result_code + * + * @return string|null + */ + public function getValidationResultCode() + { + return $this->container['validation_result_code']; + } + + /** + * Sets validation_result_code + * + * @param string|null $validation_result_code validation_result_code + * + * @return self + */ + public function setValidationResultCode($validation_result_code) + { + if (is_null($validation_result_code)) { + throw new \InvalidArgumentException('non-nullable validation_result_code cannot be null'); + } + $this->container['validation_result_code'] = $validation_result_code; + + return $this; + } + + /** + * Gets validation_error_code + * + * @return string|null + */ + public function getValidationErrorCode() + { + return $this->container['validation_error_code']; + } + + /** + * Sets validation_error_code + * + * @param string|null $validation_error_code validation_error_code + * + * @return self + */ + public function setValidationErrorCode($validation_error_code) + { + if (is_null($validation_error_code)) { + throw new \InvalidArgumentException('non-nullable validation_error_code cannot be null'); + } + $this->container['validation_error_code'] = $validation_error_code; + + return $this; + } + + /** + * Gets human_readable_message + * + * @return string|null + */ + public function getHumanReadableMessage() + { + return $this->container['human_readable_message']; + } + + /** + * Sets human_readable_message + * + * @param string|null $human_readable_message human_readable_message + * + * @return self + */ + public function setHumanReadableMessage($human_readable_message) + { + if (is_null($human_readable_message)) { + throw new \InvalidArgumentException('non-nullable human_readable_message cannot be null'); + } + $this->container['human_readable_message'] = $human_readable_message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/OrganizationData.php b/lib/Model/OrganizationData.php new file mode 100644 index 0000000..af22f7a --- /dev/null +++ b/lib/Model/OrganizationData.php @@ -0,0 +1,444 @@ + + */ +class OrganizationData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OrganizationData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'tax_code' => 'string', + 'subscription' => '\Cone\Billingo\Model\Subscription' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'tax_code' => null, + 'subscription' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tax_code' => false, + 'subscription' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tax_code' => 'tax_code', + 'subscription' => 'subscription' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tax_code' => 'setTaxCode', + 'subscription' => 'setSubscription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tax_code' => 'getTaxCode', + 'subscription' => 'getSubscription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('tax_code', $data ?? [], null); + $this->setIfExists('subscription', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets tax_code + * + * @return string|null + */ + public function getTaxCode() + { + return $this->container['tax_code']; + } + + /** + * Sets tax_code + * + * @param string|null $tax_code tax_code + * + * @return self + */ + public function setTaxCode($tax_code) + { + if (is_null($tax_code)) { + throw new \InvalidArgumentException('non-nullable tax_code cannot be null'); + } + $this->container['tax_code'] = $tax_code; + + return $this; + } + + /** + * Gets subscription + * + * @return \Cone\Billingo\Model\Subscription|null + */ + public function getSubscription() + { + return $this->container['subscription']; + } + + /** + * Sets subscription + * + * @param \Cone\Billingo\Model\Subscription|null $subscription subscription + * + * @return self + */ + public function setSubscription($subscription) + { + if (is_null($subscription)) { + throw new \InvalidArgumentException('non-nullable subscription cannot be null'); + } + $this->container['subscription'] = $subscription; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Partner.php b/lib/Model/Partner.php new file mode 100644 index 0000000..bad207f --- /dev/null +++ b/lib/Model/Partner.php @@ -0,0 +1,982 @@ + + */ +class Partner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Partner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'address' => '\Cone\Billingo\Model\Address', + 'emails' => 'string[]', + 'taxcode' => 'string', + 'iban' => 'string', + 'swift' => 'string', + 'account_number' => 'string', + 'phone' => 'string', + 'general_ledger_number' => 'string', + 'tax_type' => '\Cone\Billingo\Model\PartnerTaxType', + 'custom_billing_settings' => '\Cone\Billingo\Model\PartnerCustomBillingSettings', + 'group_member_tax_number' => 'string', + 'giro_settings' => '\Cone\Billingo\Model\PartnerGiroSettings', + 'partner_shipping' => '\Cone\Billingo\Model\DocumentPartnerPartnerShipping', + 'internal_comment' => 'string', + 'partner_show_type' => '\Cone\Billingo\Model\PartnerPartnerShowType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'address' => null, + 'emails' => null, + 'taxcode' => null, + 'iban' => null, + 'swift' => null, + 'account_number' => null, + 'phone' => null, + 'general_ledger_number' => null, + 'tax_type' => null, + 'custom_billing_settings' => null, + 'group_member_tax_number' => null, + 'giro_settings' => null, + 'partner_shipping' => null, + 'internal_comment' => null, + 'partner_show_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'address' => false, + 'emails' => false, + 'taxcode' => false, + 'iban' => false, + 'swift' => false, + 'account_number' => false, + 'phone' => false, + 'general_ledger_number' => false, + 'tax_type' => false, + 'custom_billing_settings' => false, + 'group_member_tax_number' => false, + 'giro_settings' => true, + 'partner_shipping' => true, + 'internal_comment' => true, + 'partner_show_type' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'address' => 'address', + 'emails' => 'emails', + 'taxcode' => 'taxcode', + 'iban' => 'iban', + 'swift' => 'swift', + 'account_number' => 'account_number', + 'phone' => 'phone', + 'general_ledger_number' => 'general_ledger_number', + 'tax_type' => 'tax_type', + 'custom_billing_settings' => 'custom_billing_settings', + 'group_member_tax_number' => 'group_member_tax_number', + 'giro_settings' => 'giro_settings', + 'partner_shipping' => 'partner_shipping', + 'internal_comment' => 'internal_comment', + 'partner_show_type' => 'partner_show_type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'address' => 'setAddress', + 'emails' => 'setEmails', + 'taxcode' => 'setTaxcode', + 'iban' => 'setIban', + 'swift' => 'setSwift', + 'account_number' => 'setAccountNumber', + 'phone' => 'setPhone', + 'general_ledger_number' => 'setGeneralLedgerNumber', + 'tax_type' => 'setTaxType', + 'custom_billing_settings' => 'setCustomBillingSettings', + 'group_member_tax_number' => 'setGroupMemberTaxNumber', + 'giro_settings' => 'setGiroSettings', + 'partner_shipping' => 'setPartnerShipping', + 'internal_comment' => 'setInternalComment', + 'partner_show_type' => 'setPartnerShowType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'address' => 'getAddress', + 'emails' => 'getEmails', + 'taxcode' => 'getTaxcode', + 'iban' => 'getIban', + 'swift' => 'getSwift', + 'account_number' => 'getAccountNumber', + 'phone' => 'getPhone', + 'general_ledger_number' => 'getGeneralLedgerNumber', + 'tax_type' => 'getTaxType', + 'custom_billing_settings' => 'getCustomBillingSettings', + 'group_member_tax_number' => 'getGroupMemberTaxNumber', + 'giro_settings' => 'getGiroSettings', + 'partner_shipping' => 'getPartnerShipping', + 'internal_comment' => 'getInternalComment', + 'partner_show_type' => 'getPartnerShowType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('emails', $data ?? [], null); + $this->setIfExists('taxcode', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('swift', $data ?? [], null); + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('phone', $data ?? [], null); + $this->setIfExists('general_ledger_number', $data ?? [], null); + $this->setIfExists('tax_type', $data ?? [], null); + $this->setIfExists('custom_billing_settings', $data ?? [], null); + $this->setIfExists('group_member_tax_number', $data ?? [], null); + $this->setIfExists('giro_settings', $data ?? [], null); + $this->setIfExists('partner_shipping', $data ?? [], null); + $this->setIfExists('internal_comment', $data ?? [], null); + $this->setIfExists('partner_show_type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets address + * + * @return \Cone\Billingo\Model\Address|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Cone\Billingo\Model\Address|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets emails + * + * @return string[]|null + */ + public function getEmails() + { + return $this->container['emails']; + } + + /** + * Sets emails + * + * @param string[]|null $emails emails + * + * @return self + */ + public function setEmails($emails) + { + if (is_null($emails)) { + throw new \InvalidArgumentException('non-nullable emails cannot be null'); + } + $this->container['emails'] = $emails; + + return $this; + } + + /** + * Gets taxcode + * + * @return string|null + */ + public function getTaxcode() + { + return $this->container['taxcode']; + } + + /** + * Sets taxcode + * + * @param string|null $taxcode taxcode + * + * @return self + */ + public function setTaxcode($taxcode) + { + if (is_null($taxcode)) { + throw new \InvalidArgumentException('non-nullable taxcode cannot be null'); + } + $this->container['taxcode'] = $taxcode; + + return $this; + } + + /** + * Gets iban + * + * @return string|null + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string|null $iban iban + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets swift + * + * @return string|null + */ + public function getSwift() + { + return $this->container['swift']; + } + + /** + * Sets swift + * + * @param string|null $swift swift + * + * @return self + */ + public function setSwift($swift) + { + if (is_null($swift)) { + throw new \InvalidArgumentException('non-nullable swift cannot be null'); + } + $this->container['swift'] = $swift; + + return $this; + } + + /** + * Gets account_number + * + * @return string|null + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string|null $account_number account_number + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets phone + * + * @return string|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param string|null $phone phone + * + * @return self + */ + public function setPhone($phone) + { + if (is_null($phone)) { + throw new \InvalidArgumentException('non-nullable phone cannot be null'); + } + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets general_ledger_number + * + * @return string|null + */ + public function getGeneralLedgerNumber() + { + return $this->container['general_ledger_number']; + } + + /** + * Sets general_ledger_number + * + * @param string|null $general_ledger_number general_ledger_number + * + * @return self + */ + public function setGeneralLedgerNumber($general_ledger_number) + { + if (is_null($general_ledger_number)) { + throw new \InvalidArgumentException('non-nullable general_ledger_number cannot be null'); + } + $this->container['general_ledger_number'] = $general_ledger_number; + + return $this; + } + + /** + * Gets tax_type + * + * @return \Cone\Billingo\Model\PartnerTaxType|null + */ + public function getTaxType() + { + return $this->container['tax_type']; + } + + /** + * Sets tax_type + * + * @param \Cone\Billingo\Model\PartnerTaxType|null $tax_type tax_type + * + * @return self + */ + public function setTaxType($tax_type) + { + if (is_null($tax_type)) { + throw new \InvalidArgumentException('non-nullable tax_type cannot be null'); + } + $this->container['tax_type'] = $tax_type; + + return $this; + } + + /** + * Gets custom_billing_settings + * + * @return \Cone\Billingo\Model\PartnerCustomBillingSettings|null + */ + public function getCustomBillingSettings() + { + return $this->container['custom_billing_settings']; + } + + /** + * Sets custom_billing_settings + * + * @param \Cone\Billingo\Model\PartnerCustomBillingSettings|null $custom_billing_settings custom_billing_settings + * + * @return self + */ + public function setCustomBillingSettings($custom_billing_settings) + { + if (is_null($custom_billing_settings)) { + throw new \InvalidArgumentException('non-nullable custom_billing_settings cannot be null'); + } + $this->container['custom_billing_settings'] = $custom_billing_settings; + + return $this; + } + + /** + * Gets group_member_tax_number + * + * @return string|null + */ + public function getGroupMemberTaxNumber() + { + return $this->container['group_member_tax_number']; + } + + /** + * Sets group_member_tax_number + * + * @param string|null $group_member_tax_number The tax number of group member. Send tax number for update. Send empty string for delete. Ignored if omitted. + * + * @return self + */ + public function setGroupMemberTaxNumber($group_member_tax_number) + { + if (is_null($group_member_tax_number)) { + throw new \InvalidArgumentException('non-nullable group_member_tax_number cannot be null'); + } + $this->container['group_member_tax_number'] = $group_member_tax_number; + + return $this; + } + + /** + * Gets giro_settings + * + * @return \Cone\Billingo\Model\PartnerGiroSettings|null + */ + public function getGiroSettings() + { + return $this->container['giro_settings']; + } + + /** + * Sets giro_settings + * + * @param \Cone\Billingo\Model\PartnerGiroSettings|null $giro_settings giro_settings + * + * @return self + */ + public function setGiroSettings($giro_settings) + { + if (is_null($giro_settings)) { + array_push($this->openAPINullablesSetToNull, 'giro_settings'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('giro_settings', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['giro_settings'] = $giro_settings; + + return $this; + } + + /** + * Gets partner_shipping + * + * @return \Cone\Billingo\Model\DocumentPartnerPartnerShipping|null + */ + public function getPartnerShipping() + { + return $this->container['partner_shipping']; + } + + /** + * Sets partner_shipping + * + * @param \Cone\Billingo\Model\DocumentPartnerPartnerShipping|null $partner_shipping partner_shipping + * + * @return self + */ + public function setPartnerShipping($partner_shipping) + { + if (is_null($partner_shipping)) { + array_push($this->openAPINullablesSetToNull, 'partner_shipping'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('partner_shipping', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['partner_shipping'] = $partner_shipping; + + return $this; + } + + /** + * Gets internal_comment + * + * @return string|null + */ + public function getInternalComment() + { + return $this->container['internal_comment']; + } + + /** + * Sets internal_comment + * + * @param string|null $internal_comment internal_comment + * + * @return self + */ + public function setInternalComment($internal_comment) + { + if (is_null($internal_comment)) { + array_push($this->openAPINullablesSetToNull, 'internal_comment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('internal_comment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['internal_comment'] = $internal_comment; + + return $this; + } + + /** + * Gets partner_show_type + * + * @return \Cone\Billingo\Model\PartnerPartnerShowType|null + */ + public function getPartnerShowType() + { + return $this->container['partner_show_type']; + } + + /** + * Sets partner_show_type + * + * @param \Cone\Billingo\Model\PartnerPartnerShowType|null $partner_show_type partner_show_type + * + * @return self + */ + public function setPartnerShowType($partner_show_type) + { + if (is_null($partner_show_type)) { + array_push($this->openAPINullablesSetToNull, 'partner_show_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('partner_show_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['partner_show_type'] = $partner_show_type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PartnerCustomBillingSettings.php b/lib/Model/PartnerCustomBillingSettings.php new file mode 100644 index 0000000..f903c9a --- /dev/null +++ b/lib/Model/PartnerCustomBillingSettings.php @@ -0,0 +1,580 @@ + + */ +class PartnerCustomBillingSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PartnerCustomBillingSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment_method' => '\Cone\Billingo\Model\PaymentMethod', + 'document_form' => '\Cone\Billingo\Model\DocumentForm', + 'due_days' => 'int', + 'document_currency' => '\Cone\Billingo\Model\Currency', + 'template_language_code' => '\Cone\Billingo\Model\DocumentLanguage', + 'discount' => '\Cone\Billingo\Model\Discount' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment_method' => null, + 'document_form' => null, + 'due_days' => null, + 'document_currency' => null, + 'template_language_code' => null, + 'discount' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'payment_method' => false, + 'document_form' => false, + 'due_days' => false, + 'document_currency' => false, + 'template_language_code' => false, + 'discount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment_method' => 'payment_method', + 'document_form' => 'document_form', + 'due_days' => 'due_days', + 'document_currency' => 'document_currency', + 'template_language_code' => 'template_language_code', + 'discount' => 'discount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment_method' => 'setPaymentMethod', + 'document_form' => 'setDocumentForm', + 'due_days' => 'setDueDays', + 'document_currency' => 'setDocumentCurrency', + 'template_language_code' => 'setTemplateLanguageCode', + 'discount' => 'setDiscount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment_method' => 'getPaymentMethod', + 'document_form' => 'getDocumentForm', + 'due_days' => 'getDueDays', + 'document_currency' => 'getDocumentCurrency', + 'template_language_code' => 'getTemplateLanguageCode', + 'discount' => 'getDiscount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('document_form', $data ?? [], null); + $this->setIfExists('due_days', $data ?? [], null); + $this->setIfExists('document_currency', $data ?? [], null); + $this->setIfExists('template_language_code', $data ?? [], null); + $this->setIfExists('discount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment_method + * + * @return \Cone\Billingo\Model\PaymentMethod|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Cone\Billingo\Model\PaymentMethod|null $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets document_form + * + * @return \Cone\Billingo\Model\DocumentForm|null + */ + public function getDocumentForm() + { + return $this->container['document_form']; + } + + /** + * Sets document_form + * + * @param \Cone\Billingo\Model\DocumentForm|null $document_form document_form + * + * @return self + */ + public function setDocumentForm($document_form) + { + if (is_null($document_form)) { + throw new \InvalidArgumentException('non-nullable document_form cannot be null'); + } + $this->container['document_form'] = $document_form; + + return $this; + } + + /** + * Gets due_days + * + * @return int|null + */ + public function getDueDays() + { + return $this->container['due_days']; + } + + /** + * Sets due_days + * + * @param int|null $due_days due_days + * + * @return self + */ + public function setDueDays($due_days) + { + if (is_null($due_days)) { + throw new \InvalidArgumentException('non-nullable due_days cannot be null'); + } + $this->container['due_days'] = $due_days; + + return $this; + } + + /** + * Gets document_currency + * + * @return \Cone\Billingo\Model\Currency|null + */ + public function getDocumentCurrency() + { + return $this->container['document_currency']; + } + + /** + * Sets document_currency + * + * @param \Cone\Billingo\Model\Currency|null $document_currency document_currency + * + * @return self + */ + public function setDocumentCurrency($document_currency) + { + if (is_null($document_currency)) { + throw new \InvalidArgumentException('non-nullable document_currency cannot be null'); + } + $this->container['document_currency'] = $document_currency; + + return $this; + } + + /** + * Gets template_language_code + * + * @return \Cone\Billingo\Model\DocumentLanguage|null + */ + public function getTemplateLanguageCode() + { + return $this->container['template_language_code']; + } + + /** + * Sets template_language_code + * + * @param \Cone\Billingo\Model\DocumentLanguage|null $template_language_code template_language_code + * + * @return self + */ + public function setTemplateLanguageCode($template_language_code) + { + if (is_null($template_language_code)) { + throw new \InvalidArgumentException('non-nullable template_language_code cannot be null'); + } + $this->container['template_language_code'] = $template_language_code; + + return $this; + } + + /** + * Gets discount + * + * @return \Cone\Billingo\Model\Discount|null + */ + public function getDiscount() + { + return $this->container['discount']; + } + + /** + * Sets discount + * + * @param \Cone\Billingo\Model\Discount|null $discount discount + * + * @return self + */ + public function setDiscount($discount) + { + if (is_null($discount)) { + throw new \InvalidArgumentException('non-nullable discount cannot be null'); + } + $this->container['discount'] = $discount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PartnerGiroSettings.php b/lib/Model/PartnerGiroSettings.php new file mode 100644 index 0000000..ebbf2aa --- /dev/null +++ b/lib/Model/PartnerGiroSettings.php @@ -0,0 +1,478 @@ + + */ +class PartnerGiroSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Partner_giro_settings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'giro_default_settings' => 'bool', + 'giro_payment_request_enabled' => 'bool', + 'giro_different_amount_allowed' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'giro_default_settings' => null, + 'giro_payment_request_enabled' => null, + 'giro_different_amount_allowed' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'giro_default_settings' => false, + 'giro_payment_request_enabled' => false, + 'giro_different_amount_allowed' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'giro_default_settings' => 'giro_default_settings', + 'giro_payment_request_enabled' => 'giro_payment_request_enabled', + 'giro_different_amount_allowed' => 'giro_different_amount_allowed' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'giro_default_settings' => 'setGiroDefaultSettings', + 'giro_payment_request_enabled' => 'setGiroPaymentRequestEnabled', + 'giro_different_amount_allowed' => 'setGiroDifferentAmountAllowed' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'giro_default_settings' => 'getGiroDefaultSettings', + 'giro_payment_request_enabled' => 'getGiroPaymentRequestEnabled', + 'giro_different_amount_allowed' => 'getGiroDifferentAmountAllowed' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('giro_default_settings', $data ?? [], null); + $this->setIfExists('giro_payment_request_enabled', $data ?? [], null); + $this->setIfExists('giro_different_amount_allowed', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets giro_default_settings + * + * @return bool|null + */ + public function getGiroDefaultSettings() + { + return $this->container['giro_default_settings']; + } + + /** + * Sets giro_default_settings + * + * @param bool|null $giro_default_settings giro_default_settings + * + * @return self + */ + public function setGiroDefaultSettings($giro_default_settings) + { + if (is_null($giro_default_settings)) { + throw new \InvalidArgumentException('non-nullable giro_default_settings cannot be null'); + } + $this->container['giro_default_settings'] = $giro_default_settings; + + return $this; + } + + /** + * Gets giro_payment_request_enabled + * + * @return bool|null + */ + public function getGiroPaymentRequestEnabled() + { + return $this->container['giro_payment_request_enabled']; + } + + /** + * Sets giro_payment_request_enabled + * + * @param bool|null $giro_payment_request_enabled giro_payment_request_enabled + * + * @return self + */ + public function setGiroPaymentRequestEnabled($giro_payment_request_enabled) + { + if (is_null($giro_payment_request_enabled)) { + throw new \InvalidArgumentException('non-nullable giro_payment_request_enabled cannot be null'); + } + $this->container['giro_payment_request_enabled'] = $giro_payment_request_enabled; + + return $this; + } + + /** + * Gets giro_different_amount_allowed + * + * @return bool|null + */ + public function getGiroDifferentAmountAllowed() + { + return $this->container['giro_different_amount_allowed']; + } + + /** + * Sets giro_different_amount_allowed + * + * @param bool|null $giro_different_amount_allowed giro_different_amount_allowed + * + * @return self + */ + public function setGiroDifferentAmountAllowed($giro_different_amount_allowed) + { + if (is_null($giro_different_amount_allowed)) { + throw new \InvalidArgumentException('non-nullable giro_different_amount_allowed cannot be null'); + } + $this->container['giro_different_amount_allowed'] = $giro_different_amount_allowed; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PartnerList.php b/lib/Model/PartnerList.php new file mode 100644 index 0000000..7bc3b91 --- /dev/null +++ b/lib/Model/PartnerList.php @@ -0,0 +1,615 @@ + + */ +class PartnerList implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PartnerList'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Cone\Billingo\Model\Partner[]', + 'total' => 'int', + 'per_page' => 'int', + 'current_page' => 'int', + 'last_page' => 'int', + 'prev_page_url' => 'string', + 'next_page_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'total' => null, + 'per_page' => null, + 'current_page' => null, + 'last_page' => null, + 'prev_page_url' => null, + 'next_page_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false, + 'total' => false, + 'per_page' => false, + 'current_page' => false, + 'last_page' => false, + 'prev_page_url' => false, + 'next_page_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'total' => 'total', + 'per_page' => 'per_page', + 'current_page' => 'current_page', + 'last_page' => 'last_page', + 'prev_page_url' => 'prev_page_url', + 'next_page_url' => 'next_page_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'total' => 'setTotal', + 'per_page' => 'setPerPage', + 'current_page' => 'setCurrentPage', + 'last_page' => 'setLastPage', + 'prev_page_url' => 'setPrevPageUrl', + 'next_page_url' => 'setNextPageUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'total' => 'getTotal', + 'per_page' => 'getPerPage', + 'current_page' => 'getCurrentPage', + 'last_page' => 'getLastPage', + 'prev_page_url' => 'getPrevPageUrl', + 'next_page_url' => 'getNextPageUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('per_page', $data ?? [], null); + $this->setIfExists('current_page', $data ?? [], null); + $this->setIfExists('last_page', $data ?? [], null); + $this->setIfExists('prev_page_url', $data ?? [], null); + $this->setIfExists('next_page_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Cone\Billingo\Model\Partner[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Cone\Billingo\Model\Partner[]|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets total + * + * @return int|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int|null $total total + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets per_page + * + * @return int|null + */ + public function getPerPage() + { + return $this->container['per_page']; + } + + /** + * Sets per_page + * + * @param int|null $per_page per_page + * + * @return self + */ + public function setPerPage($per_page) + { + if (is_null($per_page)) { + throw new \InvalidArgumentException('non-nullable per_page cannot be null'); + } + $this->container['per_page'] = $per_page; + + return $this; + } + + /** + * Gets current_page + * + * @return int|null + */ + public function getCurrentPage() + { + return $this->container['current_page']; + } + + /** + * Sets current_page + * + * @param int|null $current_page current_page + * + * @return self + */ + public function setCurrentPage($current_page) + { + if (is_null($current_page)) { + throw new \InvalidArgumentException('non-nullable current_page cannot be null'); + } + $this->container['current_page'] = $current_page; + + return $this; + } + + /** + * Gets last_page + * + * @return int|null + */ + public function getLastPage() + { + return $this->container['last_page']; + } + + /** + * Sets last_page + * + * @param int|null $last_page last_page + * + * @return self + */ + public function setLastPage($last_page) + { + if (is_null($last_page)) { + throw new \InvalidArgumentException('non-nullable last_page cannot be null'); + } + $this->container['last_page'] = $last_page; + + return $this; + } + + /** + * Gets prev_page_url + * + * @return string|null + */ + public function getPrevPageUrl() + { + return $this->container['prev_page_url']; + } + + /** + * Sets prev_page_url + * + * @param string|null $prev_page_url prev_page_url + * + * @return self + */ + public function setPrevPageUrl($prev_page_url) + { + if (is_null($prev_page_url)) { + throw new \InvalidArgumentException('non-nullable prev_page_url cannot be null'); + } + $this->container['prev_page_url'] = $prev_page_url; + + return $this; + } + + /** + * Gets next_page_url + * + * @return string|null + */ + public function getNextPageUrl() + { + return $this->container['next_page_url']; + } + + /** + * Sets next_page_url + * + * @param string|null $next_page_url next_page_url + * + * @return self + */ + public function setNextPageUrl($next_page_url) + { + if (is_null($next_page_url)) { + throw new \InvalidArgumentException('non-nullable next_page_url cannot be null'); + } + $this->container['next_page_url'] = $next_page_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PartnerPartnerShowType.php b/lib/Model/PartnerPartnerShowType.php new file mode 100644 index 0000000..59987b2 --- /dev/null +++ b/lib/Model/PartnerPartnerShowType.php @@ -0,0 +1,382 @@ + + */ +class PartnerPartnerShowType implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Partner_partner_show_type'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PartnerShipping.php b/lib/Model/PartnerShipping.php new file mode 100644 index 0000000..aa6de1a --- /dev/null +++ b/lib/Model/PartnerShipping.php @@ -0,0 +1,519 @@ + + */ +class PartnerShipping implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PartnerShipping'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'match' => 'bool', + 'name' => 'string', + 'mode' => '\Cone\Billingo\Model\ShippingMode', + 'address' => '\Cone\Billingo\Model\PartnerShippingAddress' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'match' => null, + 'name' => null, + 'mode' => null, + 'address' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'match' => false, + 'name' => false, + 'mode' => false, + 'address' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'match' => 'match', + 'name' => 'name', + 'mode' => 'mode', + 'address' => 'address' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'match' => 'setMatch', + 'name' => 'setName', + 'mode' => 'setMode', + 'address' => 'setAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'match' => 'getMatch', + 'name' => 'getName', + 'mode' => 'getMode', + 'address' => 'getAddress' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('match', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('mode', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets match + * + * @return bool|null + */ + public function getMatch() + { + return $this->container['match']; + } + + /** + * Sets match + * + * @param bool|null $match match + * + * @return self + */ + public function setMatch($match) + { + if (is_null($match)) { + throw new \InvalidArgumentException('non-nullable match cannot be null'); + } + $this->container['match'] = $match; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets mode + * + * @return \Cone\Billingo\Model\ShippingMode|null + */ + public function getMode() + { + return $this->container['mode']; + } + + /** + * Sets mode + * + * @param \Cone\Billingo\Model\ShippingMode|null $mode mode + * + * @return self + */ + public function setMode($mode) + { + if (is_null($mode)) { + throw new \InvalidArgumentException('non-nullable mode cannot be null'); + } + $this->container['mode'] = $mode; + + return $this; + } + + /** + * Gets address + * + * @return \Cone\Billingo\Model\PartnerShippingAddress|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Cone\Billingo\Model\PartnerShippingAddress|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + array_push($this->openAPINullablesSetToNull, 'address'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('address', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['address'] = $address; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PartnerShippingAddress.php b/lib/Model/PartnerShippingAddress.php new file mode 100644 index 0000000..e18bd37 --- /dev/null +++ b/lib/Model/PartnerShippingAddress.php @@ -0,0 +1,524 @@ + + */ +class PartnerShippingAddress implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PartnerShipping_address'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'country_code' => '\Cone\Billingo\Model\Country', + 'post_code' => 'string', + 'city' => 'string', + 'address' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'country_code' => null, + 'post_code' => null, + 'city' => null, + 'address' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'country_code' => false, + 'post_code' => false, + 'city' => false, + 'address' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country_code' => 'country_code', + 'post_code' => 'post_code', + 'city' => 'city', + 'address' => 'address' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country_code' => 'setCountryCode', + 'post_code' => 'setPostCode', + 'city' => 'setCity', + 'address' => 'setAddress' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country_code' => 'getCountryCode', + 'post_code' => 'getPostCode', + 'city' => 'getCity', + 'address' => 'getAddress' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('post_code', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['country_code'] === null) { + $invalidProperties[] = "'country_code' can't be null"; + } + if ($this->container['post_code'] === null) { + $invalidProperties[] = "'post_code' can't be null"; + } + if ($this->container['city'] === null) { + $invalidProperties[] = "'city' can't be null"; + } + if ($this->container['address'] === null) { + $invalidProperties[] = "'address' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets country_code + * + * @return \Cone\Billingo\Model\Country + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param \Cone\Billingo\Model\Country $country_code country_code + * + * @return self + */ + public function setCountryCode($country_code) + { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets post_code + * + * @return string + */ + public function getPostCode() + { + return $this->container['post_code']; + } + + /** + * Sets post_code + * + * @param string $post_code post_code + * + * @return self + */ + public function setPostCode($post_code) + { + if (is_null($post_code)) { + throw new \InvalidArgumentException('non-nullable post_code cannot be null'); + } + $this->container['post_code'] = $post_code; + + return $this; + } + + /** + * Gets city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city city + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets address + * + * @return string + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PartnerShowType.php b/lib/Model/PartnerShowType.php new file mode 100644 index 0000000..62b7d71 --- /dev/null +++ b/lib/Model/PartnerShowType.php @@ -0,0 +1,66 @@ + + */ +class PaymentHistory implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentHistory'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'date' => '\DateTime', + 'price' => 'float', + 'payment_method' => '\Cone\Billingo\Model\PaymentMethod', + 'voucher_number' => 'string', + 'conversion_rate' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'date' => 'date', + 'price' => 'float', + 'payment_method' => null, + 'voucher_number' => null, + 'conversion_rate' => 'float' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'date' => false, + 'price' => false, + 'payment_method' => false, + 'voucher_number' => true, + 'conversion_rate' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'date' => 'date', + 'price' => 'price', + 'payment_method' => 'payment_method', + 'voucher_number' => 'voucher_number', + 'conversion_rate' => 'conversion_rate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date' => 'setDate', + 'price' => 'setPrice', + 'payment_method' => 'setPaymentMethod', + 'voucher_number' => 'setVoucherNumber', + 'conversion_rate' => 'setConversionRate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date' => 'getDate', + 'price' => 'getPrice', + 'payment_method' => 'getPaymentMethod', + 'voucher_number' => 'getVoucherNumber', + 'conversion_rate' => 'getConversionRate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('voucher_number', $data ?? [], null); + $this->setIfExists('conversion_rate', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if ($this->container['price'] === null) { + $invalidProperties[] = "'price' can't be null"; + } + if ($this->container['payment_method'] === null) { + $invalidProperties[] = "'payment_method' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets date + * + * @return \DateTime + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime $date date + * + * @return self + */ + public function setDate($date) + { + if (is_null($date)) { + throw new \InvalidArgumentException('non-nullable date cannot be null'); + } + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets price + * + * @return float + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param float $price price + * + * @return self + */ + public function setPrice($price) + { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets payment_method + * + * @return \Cone\Billingo\Model\PaymentMethod + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Cone\Billingo\Model\PaymentMethod $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets voucher_number + * + * @return string|null + */ + public function getVoucherNumber() + { + return $this->container['voucher_number']; + } + + /** + * Sets voucher_number + * + * @param string|null $voucher_number voucher_number + * + * @return self + */ + public function setVoucherNumber($voucher_number) + { + if (is_null($voucher_number)) { + array_push($this->openAPINullablesSetToNull, 'voucher_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('voucher_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['voucher_number'] = $voucher_number; + + return $this; + } + + /** + * Gets conversion_rate + * + * @return float|null + */ + public function getConversionRate() + { + return $this->container['conversion_rate']; + } + + /** + * Sets conversion_rate + * + * @param float|null $conversion_rate conversion_rate + * + * @return self + */ + public function setConversionRate($conversion_rate) + { + if (is_null($conversion_rate)) { + array_push($this->openAPINullablesSetToNull, 'conversion_rate'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('conversion_rate', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['conversion_rate'] = $conversion_rate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PaymentMethod.php b/lib/Model/PaymentMethod.php new file mode 100644 index 0000000..f3d8726 --- /dev/null +++ b/lib/Model/PaymentMethod.php @@ -0,0 +1,147 @@ + + */ +class Product implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Product'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'comment' => 'string', + 'currency' => '\Cone\Billingo\Model\Currency', + 'vat' => '\Cone\Billingo\Model\Vat', + 'net_unit_price' => 'float', + 'gross_unit_price' => 'float', + 'unit' => 'string', + 'general_ledger_number' => 'string', + 'general_ledger_taxcode' => 'string', + 'entitlement' => '\Cone\Billingo\Model\Entitlement', + 'ean' => 'string', + 'sku' => 'string', + 'is_manage' => 'bool', + 'purchase_price' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'comment' => null, + 'currency' => null, + 'vat' => null, + 'net_unit_price' => 'float', + 'gross_unit_price' => 'float', + 'unit' => null, + 'general_ledger_number' => null, + 'general_ledger_taxcode' => null, + 'entitlement' => null, + 'ean' => null, + 'sku' => null, + 'is_manage' => null, + 'purchase_price' => 'float' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'comment' => false, + 'currency' => false, + 'vat' => false, + 'net_unit_price' => false, + 'gross_unit_price' => false, + 'unit' => false, + 'general_ledger_number' => false, + 'general_ledger_taxcode' => false, + 'entitlement' => false, + 'ean' => false, + 'sku' => false, + 'is_manage' => false, + 'purchase_price' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'comment' => 'comment', + 'currency' => 'currency', + 'vat' => 'vat', + 'net_unit_price' => 'net_unit_price', + 'gross_unit_price' => 'gross_unit_price', + 'unit' => 'unit', + 'general_ledger_number' => 'general_ledger_number', + 'general_ledger_taxcode' => 'general_ledger_taxcode', + 'entitlement' => 'entitlement', + 'ean' => 'ean', + 'sku' => 'sku', + 'is_manage' => 'is_manage', + 'purchase_price' => 'purchase_price' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'comment' => 'setComment', + 'currency' => 'setCurrency', + 'vat' => 'setVat', + 'net_unit_price' => 'setNetUnitPrice', + 'gross_unit_price' => 'setGrossUnitPrice', + 'unit' => 'setUnit', + 'general_ledger_number' => 'setGeneralLedgerNumber', + 'general_ledger_taxcode' => 'setGeneralLedgerTaxcode', + 'entitlement' => 'setEntitlement', + 'ean' => 'setEan', + 'sku' => 'setSku', + 'is_manage' => 'setIsManage', + 'purchase_price' => 'setPurchasePrice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'comment' => 'getComment', + 'currency' => 'getCurrency', + 'vat' => 'getVat', + 'net_unit_price' => 'getNetUnitPrice', + 'gross_unit_price' => 'getGrossUnitPrice', + 'unit' => 'getUnit', + 'general_ledger_number' => 'getGeneralLedgerNumber', + 'general_ledger_taxcode' => 'getGeneralLedgerTaxcode', + 'entitlement' => 'getEntitlement', + 'ean' => 'getEan', + 'sku' => 'getSku', + 'is_manage' => 'getIsManage', + 'purchase_price' => 'getPurchasePrice' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('comment', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('vat', $data ?? [], null); + $this->setIfExists('net_unit_price', $data ?? [], null); + $this->setIfExists('gross_unit_price', $data ?? [], null); + $this->setIfExists('unit', $data ?? [], null); + $this->setIfExists('general_ledger_number', $data ?? [], null); + $this->setIfExists('general_ledger_taxcode', $data ?? [], null); + $this->setIfExists('entitlement', $data ?? [], null); + $this->setIfExists('ean', $data ?? [], null); + $this->setIfExists('sku', $data ?? [], null); + $this->setIfExists('is_manage', $data ?? [], null); + $this->setIfExists('purchase_price', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['vat'] === null) { + $invalidProperties[] = "'vat' can't be null"; + } + if ($this->container['unit'] === null) { + $invalidProperties[] = "'unit' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets comment + * + * @return string|null + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string|null $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + throw new \InvalidArgumentException('non-nullable comment cannot be null'); + } + $this->container['comment'] = $comment; + + return $this; + } + + /** + * Gets currency + * + * @return \Cone\Billingo\Model\Currency + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param \Cone\Billingo\Model\Currency $currency currency + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets vat + * + * @return \Cone\Billingo\Model\Vat + */ + public function getVat() + { + return $this->container['vat']; + } + + /** + * Sets vat + * + * @param \Cone\Billingo\Model\Vat $vat vat + * + * @return self + */ + public function setVat($vat) + { + if (is_null($vat)) { + throw new \InvalidArgumentException('non-nullable vat cannot be null'); + } + $this->container['vat'] = $vat; + + return $this; + } + + /** + * Gets net_unit_price + * + * @return float|null + */ + public function getNetUnitPrice() + { + return $this->container['net_unit_price']; + } + + /** + * Sets net_unit_price + * + * @param float|null $net_unit_price net_unit_price + * + * @return self + */ + public function setNetUnitPrice($net_unit_price) + { + if (is_null($net_unit_price)) { + throw new \InvalidArgumentException('non-nullable net_unit_price cannot be null'); + } + $this->container['net_unit_price'] = $net_unit_price; + + return $this; + } + + /** + * Gets gross_unit_price + * + * @return float|null + */ + public function getGrossUnitPrice() + { + return $this->container['gross_unit_price']; + } + + /** + * Sets gross_unit_price + * + * @param float|null $gross_unit_price gross_unit_price + * + * @return self + */ + public function setGrossUnitPrice($gross_unit_price) + { + if (is_null($gross_unit_price)) { + throw new \InvalidArgumentException('non-nullable gross_unit_price cannot be null'); + } + $this->container['gross_unit_price'] = $gross_unit_price; + + return $this; + } + + /** + * Gets unit + * + * @return string + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string $unit unit + * + * @return self + */ + public function setUnit($unit) + { + if (is_null($unit)) { + throw new \InvalidArgumentException('non-nullable unit cannot be null'); + } + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets general_ledger_number + * + * @return string|null + */ + public function getGeneralLedgerNumber() + { + return $this->container['general_ledger_number']; + } + + /** + * Sets general_ledger_number + * + * @param string|null $general_ledger_number general_ledger_number + * + * @return self + */ + public function setGeneralLedgerNumber($general_ledger_number) + { + if (is_null($general_ledger_number)) { + throw new \InvalidArgumentException('non-nullable general_ledger_number cannot be null'); + } + $this->container['general_ledger_number'] = $general_ledger_number; + + return $this; + } + + /** + * Gets general_ledger_taxcode + * + * @return string|null + */ + public function getGeneralLedgerTaxcode() + { + return $this->container['general_ledger_taxcode']; + } + + /** + * Sets general_ledger_taxcode + * + * @param string|null $general_ledger_taxcode general_ledger_taxcode + * + * @return self + */ + public function setGeneralLedgerTaxcode($general_ledger_taxcode) + { + if (is_null($general_ledger_taxcode)) { + throw new \InvalidArgumentException('non-nullable general_ledger_taxcode cannot be null'); + } + $this->container['general_ledger_taxcode'] = $general_ledger_taxcode; + + return $this; + } + + /** + * Gets entitlement + * + * @return \Cone\Billingo\Model\Entitlement|null + */ + public function getEntitlement() + { + return $this->container['entitlement']; + } + + /** + * Sets entitlement + * + * @param \Cone\Billingo\Model\Entitlement|null $entitlement entitlement + * + * @return self + */ + public function setEntitlement($entitlement) + { + if (is_null($entitlement)) { + throw new \InvalidArgumentException('non-nullable entitlement cannot be null'); + } + $this->container['entitlement'] = $entitlement; + + return $this; + } + + /** + * Gets ean + * + * @return string|null + */ + public function getEan() + { + return $this->container['ean']; + } + + /** + * Sets ean + * + * @param string|null $ean ean + * + * @return self + */ + public function setEan($ean) + { + if (is_null($ean)) { + throw new \InvalidArgumentException('non-nullable ean cannot be null'); + } + $this->container['ean'] = $ean; + + return $this; + } + + /** + * Gets sku + * + * @return string|null + */ + public function getSku() + { + return $this->container['sku']; + } + + /** + * Sets sku + * + * @param string|null $sku sku + * + * @return self + */ + public function setSku($sku) + { + if (is_null($sku)) { + throw new \InvalidArgumentException('non-nullable sku cannot be null'); + } + $this->container['sku'] = $sku; + + return $this; + } + + /** + * Gets is_manage + * + * @return bool|null + */ + public function getIsManage() + { + return $this->container['is_manage']; + } + + /** + * Sets is_manage + * + * @param bool|null $is_manage is_manage + * + * @return self + */ + public function setIsManage($is_manage) + { + if (is_null($is_manage)) { + throw new \InvalidArgumentException('non-nullable is_manage cannot be null'); + } + $this->container['is_manage'] = $is_manage; + + return $this; + } + + /** + * Gets purchase_price + * + * @return float|null + */ + public function getPurchasePrice() + { + return $this->container['purchase_price']; + } + + /** + * Sets purchase_price + * + * @param float|null $purchase_price purchase_price + * + * @return self + */ + public function setPurchasePrice($purchase_price) + { + if (is_null($purchase_price)) { + throw new \InvalidArgumentException('non-nullable purchase_price cannot be null'); + } + $this->container['purchase_price'] = $purchase_price; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ProductList.php b/lib/Model/ProductList.php new file mode 100644 index 0000000..3502457 --- /dev/null +++ b/lib/Model/ProductList.php @@ -0,0 +1,615 @@ + + */ +class ProductList implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ProductList'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Cone\Billingo\Model\Product[]', + 'total' => 'int', + 'per_page' => 'int', + 'current_page' => 'int', + 'last_page' => 'int', + 'prev_page_url' => 'string', + 'next_page_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'total' => null, + 'per_page' => null, + 'current_page' => null, + 'last_page' => null, + 'prev_page_url' => null, + 'next_page_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false, + 'total' => false, + 'per_page' => false, + 'current_page' => false, + 'last_page' => false, + 'prev_page_url' => false, + 'next_page_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'total' => 'total', + 'per_page' => 'per_page', + 'current_page' => 'current_page', + 'last_page' => 'last_page', + 'prev_page_url' => 'prev_page_url', + 'next_page_url' => 'next_page_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'total' => 'setTotal', + 'per_page' => 'setPerPage', + 'current_page' => 'setCurrentPage', + 'last_page' => 'setLastPage', + 'prev_page_url' => 'setPrevPageUrl', + 'next_page_url' => 'setNextPageUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'total' => 'getTotal', + 'per_page' => 'getPerPage', + 'current_page' => 'getCurrentPage', + 'last_page' => 'getLastPage', + 'prev_page_url' => 'getPrevPageUrl', + 'next_page_url' => 'getNextPageUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('per_page', $data ?? [], null); + $this->setIfExists('current_page', $data ?? [], null); + $this->setIfExists('last_page', $data ?? [], null); + $this->setIfExists('prev_page_url', $data ?? [], null); + $this->setIfExists('next_page_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Cone\Billingo\Model\Product[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Cone\Billingo\Model\Product[]|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets total + * + * @return int|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int|null $total total + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets per_page + * + * @return int|null + */ + public function getPerPage() + { + return $this->container['per_page']; + } + + /** + * Sets per_page + * + * @param int|null $per_page per_page + * + * @return self + */ + public function setPerPage($per_page) + { + if (is_null($per_page)) { + throw new \InvalidArgumentException('non-nullable per_page cannot be null'); + } + $this->container['per_page'] = $per_page; + + return $this; + } + + /** + * Gets current_page + * + * @return int|null + */ + public function getCurrentPage() + { + return $this->container['current_page']; + } + + /** + * Sets current_page + * + * @param int|null $current_page current_page + * + * @return self + */ + public function setCurrentPage($current_page) + { + if (is_null($current_page)) { + throw new \InvalidArgumentException('non-nullable current_page cannot be null'); + } + $this->container['current_page'] = $current_page; + + return $this; + } + + /** + * Gets last_page + * + * @return int|null + */ + public function getLastPage() + { + return $this->container['last_page']; + } + + /** + * Sets last_page + * + * @param int|null $last_page last_page + * + * @return self + */ + public function setLastPage($last_page) + { + if (is_null($last_page)) { + throw new \InvalidArgumentException('non-nullable last_page cannot be null'); + } + $this->container['last_page'] = $last_page; + + return $this; + } + + /** + * Gets prev_page_url + * + * @return string|null + */ + public function getPrevPageUrl() + { + return $this->container['prev_page_url']; + } + + /** + * Sets prev_page_url + * + * @param string|null $prev_page_url prev_page_url + * + * @return self + */ + public function setPrevPageUrl($prev_page_url) + { + if (is_null($prev_page_url)) { + throw new \InvalidArgumentException('non-nullable prev_page_url cannot be null'); + } + $this->container['prev_page_url'] = $prev_page_url; + + return $this; + } + + /** + * Gets next_page_url + * + * @return string|null + */ + public function getNextPageUrl() + { + return $this->container['next_page_url']; + } + + /** + * Sets next_page_url + * + * @param string|null $next_page_url next_page_url + * + * @return self + */ + public function setNextPageUrl($next_page_url) + { + if (is_null($next_page_url)) { + throw new \InvalidArgumentException('non-nullable next_page_url cannot be null'); + } + $this->container['next_page_url'] = $next_page_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ProductQuantity.php b/lib/Model/ProductQuantity.php new file mode 100644 index 0000000..29ca859 --- /dev/null +++ b/lib/Model/ProductQuantity.php @@ -0,0 +1,410 @@ + + */ +class ProductQuantity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ProductQuantity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'available_quantity' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'available_quantity' => 'float' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'available_quantity' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'available_quantity' => 'available_quantity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'available_quantity' => 'setAvailableQuantity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'available_quantity' => 'getAvailableQuantity' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('available_quantity', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets available_quantity + * + * @return float|null + */ + public function getAvailableQuantity() + { + return $this->container['available_quantity']; + } + + /** + * Sets available_quantity + * + * @param float|null $available_quantity available_quantity + * + * @return self + */ + public function setAvailableQuantity($available_quantity) + { + if (is_null($available_quantity)) { + throw new \InvalidArgumentException('non-nullable available_quantity cannot be null'); + } + $this->container['available_quantity'] = $available_quantity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ReceiptInsert.php b/lib/Model/ReceiptInsert.php new file mode 100644 index 0000000..c698d09 --- /dev/null +++ b/lib/Model/ReceiptInsert.php @@ -0,0 +1,762 @@ + + */ +class ReceiptInsert implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ReceiptInsert'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'vendor_id' => 'string', + 'partner_id' => 'int', + 'name' => 'string', + 'emails' => 'string[]', + 'block_id' => 'int', + 'type' => '\Cone\Billingo\Model\DocumentType', + 'payment_method' => '\Cone\Billingo\Model\PaymentMethod', + 'currency' => '\Cone\Billingo\Model\Currency', + 'conversion_rate' => 'float', + 'electronic' => 'bool', + 'items' => '\Cone\Billingo\Model\ReceiptInsertItemsInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'vendor_id' => null, + 'partner_id' => null, + 'name' => null, + 'emails' => null, + 'block_id' => null, + 'type' => null, + 'payment_method' => null, + 'currency' => null, + 'conversion_rate' => 'float', + 'electronic' => null, + 'items' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'vendor_id' => false, + 'partner_id' => false, + 'name' => false, + 'emails' => false, + 'block_id' => false, + 'type' => false, + 'payment_method' => false, + 'currency' => false, + 'conversion_rate' => false, + 'electronic' => false, + 'items' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'vendor_id' => 'vendor_id', + 'partner_id' => 'partner_id', + 'name' => 'name', + 'emails' => 'emails', + 'block_id' => 'block_id', + 'type' => 'type', + 'payment_method' => 'payment_method', + 'currency' => 'currency', + 'conversion_rate' => 'conversion_rate', + 'electronic' => 'electronic', + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'vendor_id' => 'setVendorId', + 'partner_id' => 'setPartnerId', + 'name' => 'setName', + 'emails' => 'setEmails', + 'block_id' => 'setBlockId', + 'type' => 'setType', + 'payment_method' => 'setPaymentMethod', + 'currency' => 'setCurrency', + 'conversion_rate' => 'setConversionRate', + 'electronic' => 'setElectronic', + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'vendor_id' => 'getVendorId', + 'partner_id' => 'getPartnerId', + 'name' => 'getName', + 'emails' => 'getEmails', + 'block_id' => 'getBlockId', + 'type' => 'getType', + 'payment_method' => 'getPaymentMethod', + 'currency' => 'getCurrency', + 'conversion_rate' => 'getConversionRate', + 'electronic' => 'getElectronic', + 'items' => 'getItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('vendor_id', $data ?? [], null); + $this->setIfExists('partner_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('emails', $data ?? [], null); + $this->setIfExists('block_id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('conversion_rate', $data ?? [], null); + $this->setIfExists('electronic', $data ?? [], false); + $this->setIfExists('items', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['block_id'] === null) { + $invalidProperties[] = "'block_id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['payment_method'] === null) { + $invalidProperties[] = "'payment_method' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets vendor_id + * + * @return string|null + */ + public function getVendorId() + { + return $this->container['vendor_id']; + } + + /** + * Sets vendor_id + * + * @param string|null $vendor_id vendor_id + * + * @return self + */ + public function setVendorId($vendor_id) + { + if (is_null($vendor_id)) { + throw new \InvalidArgumentException('non-nullable vendor_id cannot be null'); + } + $this->container['vendor_id'] = $vendor_id; + + return $this; + } + + /** + * Gets partner_id + * + * @return int|null + */ + public function getPartnerId() + { + return $this->container['partner_id']; + } + + /** + * Sets partner_id + * + * @param int|null $partner_id partner_id + * + * @return self + */ + public function setPartnerId($partner_id) + { + if (is_null($partner_id)) { + throw new \InvalidArgumentException('non-nullable partner_id cannot be null'); + } + $this->container['partner_id'] = $partner_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets emails + * + * @return string[]|null + */ + public function getEmails() + { + return $this->container['emails']; + } + + /** + * Sets emails + * + * @param string[]|null $emails emails + * + * @return self + */ + public function setEmails($emails) + { + if (is_null($emails)) { + throw new \InvalidArgumentException('non-nullable emails cannot be null'); + } + $this->container['emails'] = $emails; + + return $this; + } + + /** + * Gets block_id + * + * @return int + */ + public function getBlockId() + { + return $this->container['block_id']; + } + + /** + * Sets block_id + * + * @param int $block_id block_id + * + * @return self + */ + public function setBlockId($block_id) + { + if (is_null($block_id)) { + throw new \InvalidArgumentException('non-nullable block_id cannot be null'); + } + $this->container['block_id'] = $block_id; + + return $this; + } + + /** + * Gets type + * + * @return \Cone\Billingo\Model\DocumentType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Cone\Billingo\Model\DocumentType $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets payment_method + * + * @return \Cone\Billingo\Model\PaymentMethod + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Cone\Billingo\Model\PaymentMethod $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets currency + * + * @return \Cone\Billingo\Model\Currency + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param \Cone\Billingo\Model\Currency $currency currency + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets conversion_rate + * + * @return float|null + */ + public function getConversionRate() + { + return $this->container['conversion_rate']; + } + + /** + * Sets conversion_rate + * + * @param float|null $conversion_rate conversion_rate + * + * @return self + */ + public function setConversionRate($conversion_rate) + { + if (is_null($conversion_rate)) { + throw new \InvalidArgumentException('non-nullable conversion_rate cannot be null'); + } + $this->container['conversion_rate'] = $conversion_rate; + + return $this; + } + + /** + * Gets electronic + * + * @return bool|null + */ + public function getElectronic() + { + return $this->container['electronic']; + } + + /** + * Sets electronic + * + * @param bool|null $electronic electronic + * + * @return self + */ + public function setElectronic($electronic) + { + if (is_null($electronic)) { + throw new \InvalidArgumentException('non-nullable electronic cannot be null'); + } + $this->container['electronic'] = $electronic; + + return $this; + } + + /** + * Gets items + * + * @return \Cone\Billingo\Model\ReceiptInsertItemsInner[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Cone\Billingo\Model\ReceiptInsertItemsInner[]|null $items items + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + $this->container['items'] = $items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ReceiptInsertItemsInner.php b/lib/Model/ReceiptInsertItemsInner.php new file mode 100644 index 0000000..d41a0d1 --- /dev/null +++ b/lib/Model/ReceiptInsertItemsInner.php @@ -0,0 +1,521 @@ + + */ +class ReceiptInsertItemsInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ReceiptInsert_items_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'product_id' => 'int', + 'name' => 'string', + 'unit_price' => 'float', + 'vat' => '\Cone\Billingo\Model\Vat' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'product_id' => null, + 'name' => null, + 'unit_price' => 'float', + 'vat' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'product_id' => false, + 'name' => false, + 'unit_price' => false, + 'vat' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_id' => 'product_id', + 'name' => 'name', + 'unit_price' => 'unit_price', + 'vat' => 'vat' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_id' => 'setProductId', + 'name' => 'setName', + 'unit_price' => 'setUnitPrice', + 'vat' => 'setVat' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_id' => 'getProductId', + 'name' => 'getName', + 'unit_price' => 'getUnitPrice', + 'vat' => 'getVat' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('product_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('unit_price', $data ?? [], null); + $this->setIfExists('vat', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['product_id'] === null) { + $invalidProperties[] = "'product_id' can't be null"; + } + if ($this->container['unit_price'] === null) { + $invalidProperties[] = "'unit_price' can't be null"; + } + if ($this->container['vat'] === null) { + $invalidProperties[] = "'vat' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets product_id + * + * @return int + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int $product_id product_id + * + * @return self + */ + public function setProductId($product_id) + { + if (is_null($product_id)) { + throw new \InvalidArgumentException('non-nullable product_id cannot be null'); + } + $this->container['product_id'] = $product_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets unit_price + * + * @return float + */ + public function getUnitPrice() + { + return $this->container['unit_price']; + } + + /** + * Sets unit_price + * + * @param float $unit_price unit_price + * + * @return self + */ + public function setUnitPrice($unit_price) + { + if (is_null($unit_price)) { + throw new \InvalidArgumentException('non-nullable unit_price cannot be null'); + } + $this->container['unit_price'] = $unit_price; + + return $this; + } + + /** + * Gets vat + * + * @return \Cone\Billingo\Model\Vat + */ + public function getVat() + { + return $this->container['vat']; + } + + /** + * Sets vat + * + * @param \Cone\Billingo\Model\Vat $vat vat + * + * @return self + */ + public function setVat($vat) + { + if (is_null($vat)) { + throw new \InvalidArgumentException('non-nullable vat cannot be null'); + } + $this->container['vat'] = $vat; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ReceiptItemData.php b/lib/Model/ReceiptItemData.php new file mode 100644 index 0000000..26b6804 --- /dev/null +++ b/lib/Model/ReceiptItemData.php @@ -0,0 +1,413 @@ + + */ +class ReceiptItemData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ReceiptItemData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'product_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'product_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'product_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'product_id' => 'product_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'product_id' => 'setProductId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'product_id' => 'getProductId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('product_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['product_id'] === null) { + $invalidProperties[] = "'product_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets product_id + * + * @return int + */ + public function getProductId() + { + return $this->container['product_id']; + } + + /** + * Sets product_id + * + * @param int $product_id product_id + * + * @return self + */ + public function setProductId($product_id) + { + if (is_null($product_id)) { + throw new \InvalidArgumentException('non-nullable product_id cannot be null'); + } + $this->container['product_id'] = $product_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ReceiptProductData.php b/lib/Model/ReceiptProductData.php new file mode 100644 index 0000000..c3a09d7 --- /dev/null +++ b/lib/Model/ReceiptProductData.php @@ -0,0 +1,484 @@ + + */ +class ReceiptProductData implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ReceiptProductData'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'unit_price' => 'float', + 'vat' => '\Cone\Billingo\Model\Vat' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'unit_price' => 'float', + 'vat' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'unit_price' => false, + 'vat' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'unit_price' => 'unit_price', + 'vat' => 'vat' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'unit_price' => 'setUnitPrice', + 'vat' => 'setVat' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'unit_price' => 'getUnitPrice', + 'vat' => 'getVat' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('unit_price', $data ?? [], null); + $this->setIfExists('vat', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['unit_price'] === null) { + $invalidProperties[] = "'unit_price' can't be null"; + } + if ($this->container['vat'] === null) { + $invalidProperties[] = "'vat' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets unit_price + * + * @return float + */ + public function getUnitPrice() + { + return $this->container['unit_price']; + } + + /** + * Sets unit_price + * + * @param float $unit_price unit_price + * + * @return self + */ + public function setUnitPrice($unit_price) + { + if (is_null($unit_price)) { + throw new \InvalidArgumentException('non-nullable unit_price cannot be null'); + } + $this->container['unit_price'] = $unit_price; + + return $this; + } + + /** + * Gets vat + * + * @return \Cone\Billingo\Model\Vat + */ + public function getVat() + { + return $this->container['vat']; + } + + /** + * Sets vat + * + * @param \Cone\Billingo\Model\Vat $vat vat + * + * @return self + */ + public function setVat($vat) + { + if (is_null($vat)) { + throw new \InvalidArgumentException('non-nullable vat cannot be null'); + } + $this->container['vat'] = $vat; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Round.php b/lib/Model/Round.php new file mode 100644 index 0000000..56ef9c1 --- /dev/null +++ b/lib/Model/Round.php @@ -0,0 +1,69 @@ + + */ +class SendDocument implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SendDocument'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'emails' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'emails' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'emails' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'emails' => 'emails' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'emails' => 'setEmails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'emails' => 'getEmails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('emails', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets emails + * + * @return string[]|null + */ + public function getEmails() + { + return $this->container['emails']; + } + + /** + * Sets emails + * + * @param string[]|null $emails emails + * + * @return self + */ + public function setEmails($emails) + { + if (is_null($emails)) { + throw new \InvalidArgumentException('non-nullable emails cannot be null'); + } + $this->container['emails'] = $emails; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ServerError.php b/lib/Model/ServerError.php new file mode 100644 index 0000000..5f11453 --- /dev/null +++ b/lib/Model/ServerError.php @@ -0,0 +1,444 @@ + + */ +class ServerError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ServerError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + 'trace_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + 'trace_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'message' => false, + 'trace_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + 'trace_id' => 'trace_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + 'trace_id' => 'setTraceId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + 'trace_id' => 'getTraceId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('trace_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets trace_id + * + * @return string|null + */ + public function getTraceId() + { + return $this->container['trace_id']; + } + + /** + * Sets trace_id + * + * @param string|null $trace_id You should send us this ID to investigate the issue. + * + * @return self + */ + public function setTraceId($trace_id) + { + if (is_null($trace_id)) { + throw new \InvalidArgumentException('non-nullable trace_id cannot be null'); + } + $this->container['trace_id'] = $trace_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ServerErrorResponse.php b/lib/Model/ServerErrorResponse.php new file mode 100644 index 0000000..84d7b84 --- /dev/null +++ b/lib/Model/ServerErrorResponse.php @@ -0,0 +1,410 @@ + + */ +class ServerErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ServerErrorResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'error' => '\Cone\Billingo\Model\ServerError' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'error' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'error' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'error' => 'error' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'error' => 'setError' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'error' => 'getError' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('error', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets error + * + * @return \Cone\Billingo\Model\ServerError|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param \Cone\Billingo\Model\ServerError|null $error error + * + * @return self + */ + public function setError($error) + { + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ServerTime.php b/lib/Model/ServerTime.php new file mode 100644 index 0000000..ea91a0f --- /dev/null +++ b/lib/Model/ServerTime.php @@ -0,0 +1,512 @@ + + */ +class ServerTime implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ServerTime'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'epoch' => 'int', + 'formatted' => 'string', + 'w3c' => 'string', + 'timezone' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'epoch' => null, + 'formatted' => null, + 'w3c' => null, + 'timezone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'epoch' => false, + 'formatted' => false, + 'w3c' => false, + 'timezone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'epoch' => 'epoch', + 'formatted' => 'formatted', + 'w3c' => 'w3c', + 'timezone' => 'timezone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'epoch' => 'setEpoch', + 'formatted' => 'setFormatted', + 'w3c' => 'setW3c', + 'timezone' => 'setTimezone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'epoch' => 'getEpoch', + 'formatted' => 'getFormatted', + 'w3c' => 'getW3c', + 'timezone' => 'getTimezone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('epoch', $data ?? [], null); + $this->setIfExists('formatted', $data ?? [], null); + $this->setIfExists('w3c', $data ?? [], null); + $this->setIfExists('timezone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets epoch + * + * @return int|null + */ + public function getEpoch() + { + return $this->container['epoch']; + } + + /** + * Sets epoch + * + * @param int|null $epoch epoch + * + * @return self + */ + public function setEpoch($epoch) + { + if (is_null($epoch)) { + throw new \InvalidArgumentException('non-nullable epoch cannot be null'); + } + $this->container['epoch'] = $epoch; + + return $this; + } + + /** + * Gets formatted + * + * @return string|null + */ + public function getFormatted() + { + return $this->container['formatted']; + } + + /** + * Sets formatted + * + * @param string|null $formatted formatted + * + * @return self + */ + public function setFormatted($formatted) + { + if (is_null($formatted)) { + throw new \InvalidArgumentException('non-nullable formatted cannot be null'); + } + $this->container['formatted'] = $formatted; + + return $this; + } + + /** + * Gets w3c + * + * @return string|null + */ + public function getW3c() + { + return $this->container['w3c']; + } + + /** + * Sets w3c + * + * @param string|null $w3c w3c + * + * @return self + */ + public function setW3c($w3c) + { + if (is_null($w3c)) { + throw new \InvalidArgumentException('non-nullable w3c cannot be null'); + } + $this->container['w3c'] = $w3c; + + return $this; + } + + /** + * Gets timezone + * + * @return string|null + */ + public function getTimezone() + { + return $this->container['timezone']; + } + + /** + * Sets timezone + * + * @param string|null $timezone timezone + * + * @return self + */ + public function setTimezone($timezone) + { + if (is_null($timezone)) { + throw new \InvalidArgumentException('non-nullable timezone cannot be null'); + } + $this->container['timezone'] = $timezone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShippingMode.php b/lib/Model/ShippingMode.php new file mode 100644 index 0000000..d0ff02e --- /dev/null +++ b/lib/Model/ShippingMode.php @@ -0,0 +1,66 @@ + + */ +class Spending implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Spending'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'organization_id' => 'int', + 'category' => '\Cone\Billingo\Model\Category', + 'paid_at' => '\DateTime', + 'fulfillment_date' => '\DateTime', + 'partner' => '\Cone\Billingo\Model\SpendingPartner', + 'invoice_number' => 'string', + 'currency' => '\Cone\Billingo\Model\Currency', + 'conversion_rate' => 'float', + 'total_gross' => 'float', + 'total_gross_local' => 'float', + 'total_vat_amount' => 'float', + 'total_vat_amount_local' => 'float', + 'invoice_date' => '\DateTime', + 'due_date' => '\DateTime', + 'payment_method' => '\Cone\Billingo\Model\SpendingPaymentMethod', + 'comment' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'organization_id' => null, + 'category' => null, + 'paid_at' => 'date', + 'fulfillment_date' => 'date', + 'partner' => null, + 'invoice_number' => null, + 'currency' => null, + 'conversion_rate' => 'float', + 'total_gross' => 'float', + 'total_gross_local' => 'float', + 'total_vat_amount' => 'float', + 'total_vat_amount_local' => 'float', + 'invoice_date' => 'date', + 'due_date' => 'date', + 'payment_method' => null, + 'comment' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'organization_id' => false, + 'category' => false, + 'paid_at' => true, + 'fulfillment_date' => false, + 'partner' => false, + 'invoice_number' => false, + 'currency' => false, + 'conversion_rate' => false, + 'total_gross' => false, + 'total_gross_local' => false, + 'total_vat_amount' => false, + 'total_vat_amount_local' => false, + 'invoice_date' => false, + 'due_date' => false, + 'payment_method' => false, + 'comment' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'organization_id' => 'organization_id', + 'category' => 'category', + 'paid_at' => 'paid_at', + 'fulfillment_date' => 'fulfillment_date', + 'partner' => 'partner', + 'invoice_number' => 'invoice_number', + 'currency' => 'currency', + 'conversion_rate' => 'conversion_rate', + 'total_gross' => 'total_gross', + 'total_gross_local' => 'total_gross_local', + 'total_vat_amount' => 'total_vat_amount', + 'total_vat_amount_local' => 'total_vat_amount_local', + 'invoice_date' => 'invoice_date', + 'due_date' => 'due_date', + 'payment_method' => 'payment_method', + 'comment' => 'comment' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'organization_id' => 'setOrganizationId', + 'category' => 'setCategory', + 'paid_at' => 'setPaidAt', + 'fulfillment_date' => 'setFulfillmentDate', + 'partner' => 'setPartner', + 'invoice_number' => 'setInvoiceNumber', + 'currency' => 'setCurrency', + 'conversion_rate' => 'setConversionRate', + 'total_gross' => 'setTotalGross', + 'total_gross_local' => 'setTotalGrossLocal', + 'total_vat_amount' => 'setTotalVatAmount', + 'total_vat_amount_local' => 'setTotalVatAmountLocal', + 'invoice_date' => 'setInvoiceDate', + 'due_date' => 'setDueDate', + 'payment_method' => 'setPaymentMethod', + 'comment' => 'setComment' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'organization_id' => 'getOrganizationId', + 'category' => 'getCategory', + 'paid_at' => 'getPaidAt', + 'fulfillment_date' => 'getFulfillmentDate', + 'partner' => 'getPartner', + 'invoice_number' => 'getInvoiceNumber', + 'currency' => 'getCurrency', + 'conversion_rate' => 'getConversionRate', + 'total_gross' => 'getTotalGross', + 'total_gross_local' => 'getTotalGrossLocal', + 'total_vat_amount' => 'getTotalVatAmount', + 'total_vat_amount_local' => 'getTotalVatAmountLocal', + 'invoice_date' => 'getInvoiceDate', + 'due_date' => 'getDueDate', + 'payment_method' => 'getPaymentMethod', + 'comment' => 'getComment' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('organization_id', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('paid_at', $data ?? [], null); + $this->setIfExists('fulfillment_date', $data ?? [], null); + $this->setIfExists('partner', $data ?? [], null); + $this->setIfExists('invoice_number', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('conversion_rate', $data ?? [], null); + $this->setIfExists('total_gross', $data ?? [], null); + $this->setIfExists('total_gross_local', $data ?? [], null); + $this->setIfExists('total_vat_amount', $data ?? [], null); + $this->setIfExists('total_vat_amount_local', $data ?? [], null); + $this->setIfExists('invoice_date', $data ?? [], null); + $this->setIfExists('due_date', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('comment', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets organization_id + * + * @return int|null + */ + public function getOrganizationId() + { + return $this->container['organization_id']; + } + + /** + * Sets organization_id + * + * @param int|null $organization_id organization_id + * + * @return self + */ + public function setOrganizationId($organization_id) + { + if (is_null($organization_id)) { + throw new \InvalidArgumentException('non-nullable organization_id cannot be null'); + } + $this->container['organization_id'] = $organization_id; + + return $this; + } + + /** + * Gets category + * + * @return \Cone\Billingo\Model\Category|null + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param \Cone\Billingo\Model\Category|null $category category + * + * @return self + */ + public function setCategory($category) + { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets paid_at + * + * @return \DateTime|null + */ + public function getPaidAt() + { + return $this->container['paid_at']; + } + + /** + * Sets paid_at + * + * @param \DateTime|null $paid_at paid_at + * + * @return self + */ + public function setPaidAt($paid_at) + { + if (is_null($paid_at)) { + array_push($this->openAPINullablesSetToNull, 'paid_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paid_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paid_at'] = $paid_at; + + return $this; + } + + /** + * Gets fulfillment_date + * + * @return \DateTime|null + */ + public function getFulfillmentDate() + { + return $this->container['fulfillment_date']; + } + + /** + * Sets fulfillment_date + * + * @param \DateTime|null $fulfillment_date fulfillment_date + * + * @return self + */ + public function setFulfillmentDate($fulfillment_date) + { + if (is_null($fulfillment_date)) { + throw new \InvalidArgumentException('non-nullable fulfillment_date cannot be null'); + } + $this->container['fulfillment_date'] = $fulfillment_date; + + return $this; + } + + /** + * Gets partner + * + * @return \Cone\Billingo\Model\SpendingPartner|null + */ + public function getPartner() + { + return $this->container['partner']; + } + + /** + * Sets partner + * + * @param \Cone\Billingo\Model\SpendingPartner|null $partner partner + * + * @return self + */ + public function setPartner($partner) + { + if (is_null($partner)) { + throw new \InvalidArgumentException('non-nullable partner cannot be null'); + } + $this->container['partner'] = $partner; + + return $this; + } + + /** + * Gets invoice_number + * + * @return string|null + */ + public function getInvoiceNumber() + { + return $this->container['invoice_number']; + } + + /** + * Sets invoice_number + * + * @param string|null $invoice_number invoice_number + * + * @return self + */ + public function setInvoiceNumber($invoice_number) + { + if (is_null($invoice_number)) { + throw new \InvalidArgumentException('non-nullable invoice_number cannot be null'); + } + $this->container['invoice_number'] = $invoice_number; + + return $this; + } + + /** + * Gets currency + * + * @return \Cone\Billingo\Model\Currency|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param \Cone\Billingo\Model\Currency|null $currency currency + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets conversion_rate + * + * @return float|null + */ + public function getConversionRate() + { + return $this->container['conversion_rate']; + } + + /** + * Sets conversion_rate + * + * @param float|null $conversion_rate conversion_rate + * + * @return self + */ + public function setConversionRate($conversion_rate) + { + if (is_null($conversion_rate)) { + throw new \InvalidArgumentException('non-nullable conversion_rate cannot be null'); + } + $this->container['conversion_rate'] = $conversion_rate; + + return $this; + } + + /** + * Gets total_gross + * + * @return float|null + */ + public function getTotalGross() + { + return $this->container['total_gross']; + } + + /** + * Sets total_gross + * + * @param float|null $total_gross total_gross + * + * @return self + */ + public function setTotalGross($total_gross) + { + if (is_null($total_gross)) { + throw new \InvalidArgumentException('non-nullable total_gross cannot be null'); + } + $this->container['total_gross'] = $total_gross; + + return $this; + } + + /** + * Gets total_gross_local + * + * @return float|null + */ + public function getTotalGrossLocal() + { + return $this->container['total_gross_local']; + } + + /** + * Sets total_gross_local + * + * @param float|null $total_gross_local total_gross_local + * + * @return self + */ + public function setTotalGrossLocal($total_gross_local) + { + if (is_null($total_gross_local)) { + throw new \InvalidArgumentException('non-nullable total_gross_local cannot be null'); + } + $this->container['total_gross_local'] = $total_gross_local; + + return $this; + } + + /** + * Gets total_vat_amount + * + * @return float|null + */ + public function getTotalVatAmount() + { + return $this->container['total_vat_amount']; + } + + /** + * Sets total_vat_amount + * + * @param float|null $total_vat_amount total_vat_amount + * + * @return self + */ + public function setTotalVatAmount($total_vat_amount) + { + if (is_null($total_vat_amount)) { + throw new \InvalidArgumentException('non-nullable total_vat_amount cannot be null'); + } + $this->container['total_vat_amount'] = $total_vat_amount; + + return $this; + } + + /** + * Gets total_vat_amount_local + * + * @return float|null + */ + public function getTotalVatAmountLocal() + { + return $this->container['total_vat_amount_local']; + } + + /** + * Sets total_vat_amount_local + * + * @param float|null $total_vat_amount_local total_vat_amount_local + * + * @return self + */ + public function setTotalVatAmountLocal($total_vat_amount_local) + { + if (is_null($total_vat_amount_local)) { + throw new \InvalidArgumentException('non-nullable total_vat_amount_local cannot be null'); + } + $this->container['total_vat_amount_local'] = $total_vat_amount_local; + + return $this; + } + + /** + * Gets invoice_date + * + * @return \DateTime|null + */ + public function getInvoiceDate() + { + return $this->container['invoice_date']; + } + + /** + * Sets invoice_date + * + * @param \DateTime|null $invoice_date invoice_date + * + * @return self + */ + public function setInvoiceDate($invoice_date) + { + if (is_null($invoice_date)) { + throw new \InvalidArgumentException('non-nullable invoice_date cannot be null'); + } + $this->container['invoice_date'] = $invoice_date; + + return $this; + } + + /** + * Gets due_date + * + * @return \DateTime|null + */ + public function getDueDate() + { + return $this->container['due_date']; + } + + /** + * Sets due_date + * + * @param \DateTime|null $due_date due_date + * + * @return self + */ + public function setDueDate($due_date) + { + if (is_null($due_date)) { + throw new \InvalidArgumentException('non-nullable due_date cannot be null'); + } + $this->container['due_date'] = $due_date; + + return $this; + } + + /** + * Gets payment_method + * + * @return \Cone\Billingo\Model\SpendingPaymentMethod|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Cone\Billingo\Model\SpendingPaymentMethod|null $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets comment + * + * @return string|null + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string|null $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + array_push($this->openAPINullablesSetToNull, 'comment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('comment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['comment'] = $comment; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SpendingList.php b/lib/Model/SpendingList.php new file mode 100644 index 0000000..9aa7394 --- /dev/null +++ b/lib/Model/SpendingList.php @@ -0,0 +1,615 @@ + + */ +class SpendingList implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SpendingList'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Cone\Billingo\Model\SpendingListItem[]', + 'total' => 'int', + 'per_page' => 'int', + 'current_page' => 'int', + 'last_page' => 'int', + 'prev_page_url' => 'string', + 'next_page_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'total' => null, + 'per_page' => null, + 'current_page' => null, + 'last_page' => null, + 'prev_page_url' => null, + 'next_page_url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false, + 'total' => false, + 'per_page' => false, + 'current_page' => false, + 'last_page' => false, + 'prev_page_url' => false, + 'next_page_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'total' => 'total', + 'per_page' => 'per_page', + 'current_page' => 'current_page', + 'last_page' => 'last_page', + 'prev_page_url' => 'prev_page_url', + 'next_page_url' => 'next_page_url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'total' => 'setTotal', + 'per_page' => 'setPerPage', + 'current_page' => 'setCurrentPage', + 'last_page' => 'setLastPage', + 'prev_page_url' => 'setPrevPageUrl', + 'next_page_url' => 'setNextPageUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'total' => 'getTotal', + 'per_page' => 'getPerPage', + 'current_page' => 'getCurrentPage', + 'last_page' => 'getLastPage', + 'prev_page_url' => 'getPrevPageUrl', + 'next_page_url' => 'getNextPageUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('per_page', $data ?? [], null); + $this->setIfExists('current_page', $data ?? [], null); + $this->setIfExists('last_page', $data ?? [], null); + $this->setIfExists('prev_page_url', $data ?? [], null); + $this->setIfExists('next_page_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Cone\Billingo\Model\SpendingListItem[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Cone\Billingo\Model\SpendingListItem[]|null $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets total + * + * @return int|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int|null $total total + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets per_page + * + * @return int|null + */ + public function getPerPage() + { + return $this->container['per_page']; + } + + /** + * Sets per_page + * + * @param int|null $per_page per_page + * + * @return self + */ + public function setPerPage($per_page) + { + if (is_null($per_page)) { + throw new \InvalidArgumentException('non-nullable per_page cannot be null'); + } + $this->container['per_page'] = $per_page; + + return $this; + } + + /** + * Gets current_page + * + * @return int|null + */ + public function getCurrentPage() + { + return $this->container['current_page']; + } + + /** + * Sets current_page + * + * @param int|null $current_page current_page + * + * @return self + */ + public function setCurrentPage($current_page) + { + if (is_null($current_page)) { + throw new \InvalidArgumentException('non-nullable current_page cannot be null'); + } + $this->container['current_page'] = $current_page; + + return $this; + } + + /** + * Gets last_page + * + * @return int|null + */ + public function getLastPage() + { + return $this->container['last_page']; + } + + /** + * Sets last_page + * + * @param int|null $last_page last_page + * + * @return self + */ + public function setLastPage($last_page) + { + if (is_null($last_page)) { + throw new \InvalidArgumentException('non-nullable last_page cannot be null'); + } + $this->container['last_page'] = $last_page; + + return $this; + } + + /** + * Gets prev_page_url + * + * @return string|null + */ + public function getPrevPageUrl() + { + return $this->container['prev_page_url']; + } + + /** + * Sets prev_page_url + * + * @param string|null $prev_page_url prev_page_url + * + * @return self + */ + public function setPrevPageUrl($prev_page_url) + { + if (is_null($prev_page_url)) { + throw new \InvalidArgumentException('non-nullable prev_page_url cannot be null'); + } + $this->container['prev_page_url'] = $prev_page_url; + + return $this; + } + + /** + * Gets next_page_url + * + * @return string|null + */ + public function getNextPageUrl() + { + return $this->container['next_page_url']; + } + + /** + * Sets next_page_url + * + * @param string|null $next_page_url next_page_url + * + * @return self + */ + public function setNextPageUrl($next_page_url) + { + if (is_null($next_page_url)) { + throw new \InvalidArgumentException('non-nullable next_page_url cannot be null'); + } + $this->container['next_page_url'] = $next_page_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SpendingListItem.php b/lib/Model/SpendingListItem.php new file mode 100644 index 0000000..99acbcd --- /dev/null +++ b/lib/Model/SpendingListItem.php @@ -0,0 +1,1002 @@ + + */ +class SpendingListItem implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SpendingListItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'organization_id' => 'int', + 'category' => '\Cone\Billingo\Model\Category', + 'paid_at' => '\DateTime', + 'fulfillment_date' => '\DateTime', + 'partner' => '\Cone\Billingo\Model\SpendingPartner', + 'invoice_number' => 'string', + 'currency' => '\Cone\Billingo\Model\Currency', + 'conversion_rate' => 'float', + 'total_gross' => 'float', + 'total_gross_local' => 'float', + 'total_vat_amount' => 'float', + 'total_vat_amount_local' => 'float', + 'invoice_date' => '\DateTime', + 'due_date' => '\DateTime', + 'payment_method' => '\Cone\Billingo\Model\SpendingPaymentMethod', + 'comment' => 'string', + 'is_created_by_nav' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'organization_id' => null, + 'category' => null, + 'paid_at' => 'date', + 'fulfillment_date' => 'date', + 'partner' => null, + 'invoice_number' => null, + 'currency' => null, + 'conversion_rate' => 'float', + 'total_gross' => 'float', + 'total_gross_local' => 'float', + 'total_vat_amount' => 'float', + 'total_vat_amount_local' => 'float', + 'invoice_date' => 'date', + 'due_date' => 'date', + 'payment_method' => null, + 'comment' => null, + 'is_created_by_nav' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'organization_id' => false, + 'category' => false, + 'paid_at' => true, + 'fulfillment_date' => false, + 'partner' => false, + 'invoice_number' => false, + 'currency' => false, + 'conversion_rate' => false, + 'total_gross' => false, + 'total_gross_local' => false, + 'total_vat_amount' => false, + 'total_vat_amount_local' => false, + 'invoice_date' => false, + 'due_date' => false, + 'payment_method' => false, + 'comment' => true, + 'is_created_by_nav' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'organization_id' => 'organization_id', + 'category' => 'category', + 'paid_at' => 'paid_at', + 'fulfillment_date' => 'fulfillment_date', + 'partner' => 'partner', + 'invoice_number' => 'invoice_number', + 'currency' => 'currency', + 'conversion_rate' => 'conversion_rate', + 'total_gross' => 'total_gross', + 'total_gross_local' => 'total_gross_local', + 'total_vat_amount' => 'total_vat_amount', + 'total_vat_amount_local' => 'total_vat_amount_local', + 'invoice_date' => 'invoice_date', + 'due_date' => 'due_date', + 'payment_method' => 'payment_method', + 'comment' => 'comment', + 'is_created_by_nav' => 'is_created_by_nav' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'organization_id' => 'setOrganizationId', + 'category' => 'setCategory', + 'paid_at' => 'setPaidAt', + 'fulfillment_date' => 'setFulfillmentDate', + 'partner' => 'setPartner', + 'invoice_number' => 'setInvoiceNumber', + 'currency' => 'setCurrency', + 'conversion_rate' => 'setConversionRate', + 'total_gross' => 'setTotalGross', + 'total_gross_local' => 'setTotalGrossLocal', + 'total_vat_amount' => 'setTotalVatAmount', + 'total_vat_amount_local' => 'setTotalVatAmountLocal', + 'invoice_date' => 'setInvoiceDate', + 'due_date' => 'setDueDate', + 'payment_method' => 'setPaymentMethod', + 'comment' => 'setComment', + 'is_created_by_nav' => 'setIsCreatedByNav' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'organization_id' => 'getOrganizationId', + 'category' => 'getCategory', + 'paid_at' => 'getPaidAt', + 'fulfillment_date' => 'getFulfillmentDate', + 'partner' => 'getPartner', + 'invoice_number' => 'getInvoiceNumber', + 'currency' => 'getCurrency', + 'conversion_rate' => 'getConversionRate', + 'total_gross' => 'getTotalGross', + 'total_gross_local' => 'getTotalGrossLocal', + 'total_vat_amount' => 'getTotalVatAmount', + 'total_vat_amount_local' => 'getTotalVatAmountLocal', + 'invoice_date' => 'getInvoiceDate', + 'due_date' => 'getDueDate', + 'payment_method' => 'getPaymentMethod', + 'comment' => 'getComment', + 'is_created_by_nav' => 'getIsCreatedByNav' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('organization_id', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('paid_at', $data ?? [], null); + $this->setIfExists('fulfillment_date', $data ?? [], null); + $this->setIfExists('partner', $data ?? [], null); + $this->setIfExists('invoice_number', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('conversion_rate', $data ?? [], null); + $this->setIfExists('total_gross', $data ?? [], null); + $this->setIfExists('total_gross_local', $data ?? [], null); + $this->setIfExists('total_vat_amount', $data ?? [], null); + $this->setIfExists('total_vat_amount_local', $data ?? [], null); + $this->setIfExists('invoice_date', $data ?? [], null); + $this->setIfExists('due_date', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('comment', $data ?? [], null); + $this->setIfExists('is_created_by_nav', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets organization_id + * + * @return int|null + */ + public function getOrganizationId() + { + return $this->container['organization_id']; + } + + /** + * Sets organization_id + * + * @param int|null $organization_id organization_id + * + * @return self + */ + public function setOrganizationId($organization_id) + { + if (is_null($organization_id)) { + throw new \InvalidArgumentException('non-nullable organization_id cannot be null'); + } + $this->container['organization_id'] = $organization_id; + + return $this; + } + + /** + * Gets category + * + * @return \Cone\Billingo\Model\Category|null + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param \Cone\Billingo\Model\Category|null $category category + * + * @return self + */ + public function setCategory($category) + { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets paid_at + * + * @return \DateTime|null + */ + public function getPaidAt() + { + return $this->container['paid_at']; + } + + /** + * Sets paid_at + * + * @param \DateTime|null $paid_at paid_at + * + * @return self + */ + public function setPaidAt($paid_at) + { + if (is_null($paid_at)) { + array_push($this->openAPINullablesSetToNull, 'paid_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paid_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paid_at'] = $paid_at; + + return $this; + } + + /** + * Gets fulfillment_date + * + * @return \DateTime|null + */ + public function getFulfillmentDate() + { + return $this->container['fulfillment_date']; + } + + /** + * Sets fulfillment_date + * + * @param \DateTime|null $fulfillment_date fulfillment_date + * + * @return self + */ + public function setFulfillmentDate($fulfillment_date) + { + if (is_null($fulfillment_date)) { + throw new \InvalidArgumentException('non-nullable fulfillment_date cannot be null'); + } + $this->container['fulfillment_date'] = $fulfillment_date; + + return $this; + } + + /** + * Gets partner + * + * @return \Cone\Billingo\Model\SpendingPartner|null + */ + public function getPartner() + { + return $this->container['partner']; + } + + /** + * Sets partner + * + * @param \Cone\Billingo\Model\SpendingPartner|null $partner partner + * + * @return self + */ + public function setPartner($partner) + { + if (is_null($partner)) { + throw new \InvalidArgumentException('non-nullable partner cannot be null'); + } + $this->container['partner'] = $partner; + + return $this; + } + + /** + * Gets invoice_number + * + * @return string|null + */ + public function getInvoiceNumber() + { + return $this->container['invoice_number']; + } + + /** + * Sets invoice_number + * + * @param string|null $invoice_number invoice_number + * + * @return self + */ + public function setInvoiceNumber($invoice_number) + { + if (is_null($invoice_number)) { + throw new \InvalidArgumentException('non-nullable invoice_number cannot be null'); + } + $this->container['invoice_number'] = $invoice_number; + + return $this; + } + + /** + * Gets currency + * + * @return \Cone\Billingo\Model\Currency|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param \Cone\Billingo\Model\Currency|null $currency currency + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets conversion_rate + * + * @return float|null + */ + public function getConversionRate() + { + return $this->container['conversion_rate']; + } + + /** + * Sets conversion_rate + * + * @param float|null $conversion_rate conversion_rate + * + * @return self + */ + public function setConversionRate($conversion_rate) + { + if (is_null($conversion_rate)) { + throw new \InvalidArgumentException('non-nullable conversion_rate cannot be null'); + } + $this->container['conversion_rate'] = $conversion_rate; + + return $this; + } + + /** + * Gets total_gross + * + * @return float|null + */ + public function getTotalGross() + { + return $this->container['total_gross']; + } + + /** + * Sets total_gross + * + * @param float|null $total_gross total_gross + * + * @return self + */ + public function setTotalGross($total_gross) + { + if (is_null($total_gross)) { + throw new \InvalidArgumentException('non-nullable total_gross cannot be null'); + } + $this->container['total_gross'] = $total_gross; + + return $this; + } + + /** + * Gets total_gross_local + * + * @return float|null + */ + public function getTotalGrossLocal() + { + return $this->container['total_gross_local']; + } + + /** + * Sets total_gross_local + * + * @param float|null $total_gross_local total_gross_local + * + * @return self + */ + public function setTotalGrossLocal($total_gross_local) + { + if (is_null($total_gross_local)) { + throw new \InvalidArgumentException('non-nullable total_gross_local cannot be null'); + } + $this->container['total_gross_local'] = $total_gross_local; + + return $this; + } + + /** + * Gets total_vat_amount + * + * @return float|null + */ + public function getTotalVatAmount() + { + return $this->container['total_vat_amount']; + } + + /** + * Sets total_vat_amount + * + * @param float|null $total_vat_amount total_vat_amount + * + * @return self + */ + public function setTotalVatAmount($total_vat_amount) + { + if (is_null($total_vat_amount)) { + throw new \InvalidArgumentException('non-nullable total_vat_amount cannot be null'); + } + $this->container['total_vat_amount'] = $total_vat_amount; + + return $this; + } + + /** + * Gets total_vat_amount_local + * + * @return float|null + */ + public function getTotalVatAmountLocal() + { + return $this->container['total_vat_amount_local']; + } + + /** + * Sets total_vat_amount_local + * + * @param float|null $total_vat_amount_local total_vat_amount_local + * + * @return self + */ + public function setTotalVatAmountLocal($total_vat_amount_local) + { + if (is_null($total_vat_amount_local)) { + throw new \InvalidArgumentException('non-nullable total_vat_amount_local cannot be null'); + } + $this->container['total_vat_amount_local'] = $total_vat_amount_local; + + return $this; + } + + /** + * Gets invoice_date + * + * @return \DateTime|null + */ + public function getInvoiceDate() + { + return $this->container['invoice_date']; + } + + /** + * Sets invoice_date + * + * @param \DateTime|null $invoice_date invoice_date + * + * @return self + */ + public function setInvoiceDate($invoice_date) + { + if (is_null($invoice_date)) { + throw new \InvalidArgumentException('non-nullable invoice_date cannot be null'); + } + $this->container['invoice_date'] = $invoice_date; + + return $this; + } + + /** + * Gets due_date + * + * @return \DateTime|null + */ + public function getDueDate() + { + return $this->container['due_date']; + } + + /** + * Sets due_date + * + * @param \DateTime|null $due_date due_date + * + * @return self + */ + public function setDueDate($due_date) + { + if (is_null($due_date)) { + throw new \InvalidArgumentException('non-nullable due_date cannot be null'); + } + $this->container['due_date'] = $due_date; + + return $this; + } + + /** + * Gets payment_method + * + * @return \Cone\Billingo\Model\SpendingPaymentMethod|null + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Cone\Billingo\Model\SpendingPaymentMethod|null $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets comment + * + * @return string|null + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string|null $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + array_push($this->openAPINullablesSetToNull, 'comment'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('comment', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['comment'] = $comment; + + return $this; + } + + /** + * Gets is_created_by_nav + * + * @return bool|null + */ + public function getIsCreatedByNav() + { + return $this->container['is_created_by_nav']; + } + + /** + * Sets is_created_by_nav + * + * @param bool|null $is_created_by_nav is_created_by_nav + * + * @return self + */ + public function setIsCreatedByNav($is_created_by_nav) + { + if (is_null($is_created_by_nav)) { + throw new \InvalidArgumentException('non-nullable is_created_by_nav cannot be null'); + } + $this->container['is_created_by_nav'] = $is_created_by_nav; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SpendingPartner.php b/lib/Model/SpendingPartner.php new file mode 100644 index 0000000..1c702a3 --- /dev/null +++ b/lib/Model/SpendingPartner.php @@ -0,0 +1,716 @@ + + */ +class SpendingPartner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SpendingPartner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'int', + 'name' => 'string', + 'tax_code' => 'string', + 'address' => '\Cone\Billingo\Model\Address', + 'iban' => 'string', + 'swift' => 'string', + 'account_number' => 'string', + 'phone' => 'string', + 'internal_comment' => 'string', + 'group_member_tax_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'tax_code' => null, + 'address' => null, + 'iban' => null, + 'swift' => null, + 'account_number' => null, + 'phone' => null, + 'internal_comment' => null, + 'group_member_tax_number' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'tax_code' => false, + 'address' => false, + 'iban' => false, + 'swift' => false, + 'account_number' => false, + 'phone' => false, + 'internal_comment' => false, + 'group_member_tax_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'tax_code' => 'tax_code', + 'address' => 'address', + 'iban' => 'iban', + 'swift' => 'swift', + 'account_number' => 'account_number', + 'phone' => 'phone', + 'internal_comment' => 'internal_comment', + 'group_member_tax_number' => 'group_member_tax_number' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'tax_code' => 'setTaxCode', + 'address' => 'setAddress', + 'iban' => 'setIban', + 'swift' => 'setSwift', + 'account_number' => 'setAccountNumber', + 'phone' => 'setPhone', + 'internal_comment' => 'setInternalComment', + 'group_member_tax_number' => 'setGroupMemberTaxNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'tax_code' => 'getTaxCode', + 'address' => 'getAddress', + 'iban' => 'getIban', + 'swift' => 'getSwift', + 'account_number' => 'getAccountNumber', + 'phone' => 'getPhone', + 'internal_comment' => 'getInternalComment', + 'group_member_tax_number' => 'getGroupMemberTaxNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('tax_code', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('swift', $data ?? [], null); + $this->setIfExists('account_number', $data ?? [], null); + $this->setIfExists('phone', $data ?? [], null); + $this->setIfExists('internal_comment', $data ?? [], null); + $this->setIfExists('group_member_tax_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return int|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets tax_code + * + * @return string|null + */ + public function getTaxCode() + { + return $this->container['tax_code']; + } + + /** + * Sets tax_code + * + * @param string|null $tax_code tax_code + * + * @return self + */ + public function setTaxCode($tax_code) + { + if (is_null($tax_code)) { + throw new \InvalidArgumentException('non-nullable tax_code cannot be null'); + } + $this->container['tax_code'] = $tax_code; + + return $this; + } + + /** + * Gets address + * + * @return \Cone\Billingo\Model\Address|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Cone\Billingo\Model\Address|null $address address + * + * @return self + */ + public function setAddress($address) + { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets iban + * + * @return string|null + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @param string|null $iban iban + * + * @return self + */ + public function setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets swift + * + * @return string|null + */ + public function getSwift() + { + return $this->container['swift']; + } + + /** + * Sets swift + * + * @param string|null $swift swift + * + * @return self + */ + public function setSwift($swift) + { + if (is_null($swift)) { + throw new \InvalidArgumentException('non-nullable swift cannot be null'); + } + $this->container['swift'] = $swift; + + return $this; + } + + /** + * Gets account_number + * + * @return string|null + */ + public function getAccountNumber() + { + return $this->container['account_number']; + } + + /** + * Sets account_number + * + * @param string|null $account_number account_number + * + * @return self + */ + public function setAccountNumber($account_number) + { + if (is_null($account_number)) { + throw new \InvalidArgumentException('non-nullable account_number cannot be null'); + } + $this->container['account_number'] = $account_number; + + return $this; + } + + /** + * Gets phone + * + * @return string|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param string|null $phone phone + * + * @return self + */ + public function setPhone($phone) + { + if (is_null($phone)) { + throw new \InvalidArgumentException('non-nullable phone cannot be null'); + } + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets internal_comment + * + * @return string|null + */ + public function getInternalComment() + { + return $this->container['internal_comment']; + } + + /** + * Sets internal_comment + * + * @param string|null $internal_comment internal_comment + * + * @return self + */ + public function setInternalComment($internal_comment) + { + if (is_null($internal_comment)) { + throw new \InvalidArgumentException('non-nullable internal_comment cannot be null'); + } + $this->container['internal_comment'] = $internal_comment; + + return $this; + } + + /** + * Gets group_member_tax_number + * + * @return string|null + */ + public function getGroupMemberTaxNumber() + { + return $this->container['group_member_tax_number']; + } + + /** + * Sets group_member_tax_number + * + * @param string|null $group_member_tax_number group_member_tax_number + * + * @return self + */ + public function setGroupMemberTaxNumber($group_member_tax_number) + { + if (is_null($group_member_tax_number)) { + throw new \InvalidArgumentException('non-nullable group_member_tax_number cannot be null'); + } + $this->container['group_member_tax_number'] = $group_member_tax_number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SpendingPaymentMethod.php b/lib/Model/SpendingPaymentMethod.php new file mode 100644 index 0000000..27a4440 --- /dev/null +++ b/lib/Model/SpendingPaymentMethod.php @@ -0,0 +1,147 @@ + + */ +class SpendingSave implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SpendingSave'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => '\Cone\Billingo\Model\Currency', + 'conversion_rate' => 'float', + 'total_gross' => 'float', + 'total_gross_huf' => 'float', + 'total_vat_amount' => 'float', + 'total_vat_amount_huf' => 'float', + 'fulfillment_date' => '\DateTime', + 'paid_at' => '\DateTime', + 'category' => '\Cone\Billingo\Model\Category', + 'comment' => 'string', + 'invoice_number' => 'string', + 'invoice_date' => '\DateTime', + 'due_date' => '\DateTime', + 'payment_method' => '\Cone\Billingo\Model\SpendingPaymentMethod', + 'partner_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'conversion_rate' => 'float', + 'total_gross' => 'float', + 'total_gross_huf' => 'float', + 'total_vat_amount' => 'float', + 'total_vat_amount_huf' => 'float', + 'fulfillment_date' => 'date', + 'paid_at' => 'date', + 'category' => null, + 'comment' => null, + 'invoice_number' => null, + 'invoice_date' => 'date', + 'due_date' => 'date', + 'payment_method' => null, + 'partner_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'currency' => false, + 'conversion_rate' => false, + 'total_gross' => false, + 'total_gross_huf' => false, + 'total_vat_amount' => false, + 'total_vat_amount_huf' => false, + 'fulfillment_date' => false, + 'paid_at' => false, + 'category' => false, + 'comment' => false, + 'invoice_number' => false, + 'invoice_date' => false, + 'due_date' => false, + 'payment_method' => false, + 'partner_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'conversion_rate' => 'conversion_rate', + 'total_gross' => 'total_gross', + 'total_gross_huf' => 'total_gross_huf', + 'total_vat_amount' => 'total_vat_amount', + 'total_vat_amount_huf' => 'total_vat_amount_huf', + 'fulfillment_date' => 'fulfillment_date', + 'paid_at' => 'paid_at', + 'category' => 'category', + 'comment' => 'comment', + 'invoice_number' => 'invoice_number', + 'invoice_date' => 'invoice_date', + 'due_date' => 'due_date', + 'payment_method' => 'payment_method', + 'partner_id' => 'partner_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'conversion_rate' => 'setConversionRate', + 'total_gross' => 'setTotalGross', + 'total_gross_huf' => 'setTotalGrossHuf', + 'total_vat_amount' => 'setTotalVatAmount', + 'total_vat_amount_huf' => 'setTotalVatAmountHuf', + 'fulfillment_date' => 'setFulfillmentDate', + 'paid_at' => 'setPaidAt', + 'category' => 'setCategory', + 'comment' => 'setComment', + 'invoice_number' => 'setInvoiceNumber', + 'invoice_date' => 'setInvoiceDate', + 'due_date' => 'setDueDate', + 'payment_method' => 'setPaymentMethod', + 'partner_id' => 'setPartnerId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'conversion_rate' => 'getConversionRate', + 'total_gross' => 'getTotalGross', + 'total_gross_huf' => 'getTotalGrossHuf', + 'total_vat_amount' => 'getTotalVatAmount', + 'total_vat_amount_huf' => 'getTotalVatAmountHuf', + 'fulfillment_date' => 'getFulfillmentDate', + 'paid_at' => 'getPaidAt', + 'category' => 'getCategory', + 'comment' => 'getComment', + 'invoice_number' => 'getInvoiceNumber', + 'invoice_date' => 'getInvoiceDate', + 'due_date' => 'getDueDate', + 'payment_method' => 'getPaymentMethod', + 'partner_id' => 'getPartnerId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('conversion_rate', $data ?? [], null); + $this->setIfExists('total_gross', $data ?? [], null); + $this->setIfExists('total_gross_huf', $data ?? [], null); + $this->setIfExists('total_vat_amount', $data ?? [], null); + $this->setIfExists('total_vat_amount_huf', $data ?? [], null); + $this->setIfExists('fulfillment_date', $data ?? [], null); + $this->setIfExists('paid_at', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('comment', $data ?? [], null); + $this->setIfExists('invoice_number', $data ?? [], null); + $this->setIfExists('invoice_date', $data ?? [], null); + $this->setIfExists('due_date', $data ?? [], null); + $this->setIfExists('payment_method', $data ?? [], null); + $this->setIfExists('partner_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['total_gross'] === null) { + $invalidProperties[] = "'total_gross' can't be null"; + } + if ($this->container['total_gross_huf'] === null) { + $invalidProperties[] = "'total_gross_huf' can't be null"; + } + if ($this->container['total_vat_amount'] === null) { + $invalidProperties[] = "'total_vat_amount' can't be null"; + } + if ($this->container['total_vat_amount_huf'] === null) { + $invalidProperties[] = "'total_vat_amount_huf' can't be null"; + } + if ($this->container['fulfillment_date'] === null) { + $invalidProperties[] = "'fulfillment_date' can't be null"; + } + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } + if ($this->container['payment_method'] === null) { + $invalidProperties[] = "'payment_method' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return \Cone\Billingo\Model\Currency + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param \Cone\Billingo\Model\Currency $currency currency + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets conversion_rate + * + * @return float|null + */ + public function getConversionRate() + { + return $this->container['conversion_rate']; + } + + /** + * Sets conversion_rate + * + * @param float|null $conversion_rate conversion_rate + * + * @return self + */ + public function setConversionRate($conversion_rate) + { + if (is_null($conversion_rate)) { + throw new \InvalidArgumentException('non-nullable conversion_rate cannot be null'); + } + $this->container['conversion_rate'] = $conversion_rate; + + return $this; + } + + /** + * Gets total_gross + * + * @return float + */ + public function getTotalGross() + { + return $this->container['total_gross']; + } + + /** + * Sets total_gross + * + * @param float $total_gross total_gross + * + * @return self + */ + public function setTotalGross($total_gross) + { + if (is_null($total_gross)) { + throw new \InvalidArgumentException('non-nullable total_gross cannot be null'); + } + $this->container['total_gross'] = $total_gross; + + return $this; + } + + /** + * Gets total_gross_huf + * + * @return float + */ + public function getTotalGrossHuf() + { + return $this->container['total_gross_huf']; + } + + /** + * Sets total_gross_huf + * + * @param float $total_gross_huf total_gross_huf + * + * @return self + */ + public function setTotalGrossHuf($total_gross_huf) + { + if (is_null($total_gross_huf)) { + throw new \InvalidArgumentException('non-nullable total_gross_huf cannot be null'); + } + $this->container['total_gross_huf'] = $total_gross_huf; + + return $this; + } + + /** + * Gets total_vat_amount + * + * @return float + */ + public function getTotalVatAmount() + { + return $this->container['total_vat_amount']; + } + + /** + * Sets total_vat_amount + * + * @param float $total_vat_amount total_vat_amount + * + * @return self + */ + public function setTotalVatAmount($total_vat_amount) + { + if (is_null($total_vat_amount)) { + throw new \InvalidArgumentException('non-nullable total_vat_amount cannot be null'); + } + $this->container['total_vat_amount'] = $total_vat_amount; + + return $this; + } + + /** + * Gets total_vat_amount_huf + * + * @return float + */ + public function getTotalVatAmountHuf() + { + return $this->container['total_vat_amount_huf']; + } + + /** + * Sets total_vat_amount_huf + * + * @param float $total_vat_amount_huf total_vat_amount_huf + * + * @return self + */ + public function setTotalVatAmountHuf($total_vat_amount_huf) + { + if (is_null($total_vat_amount_huf)) { + throw new \InvalidArgumentException('non-nullable total_vat_amount_huf cannot be null'); + } + $this->container['total_vat_amount_huf'] = $total_vat_amount_huf; + + return $this; + } + + /** + * Gets fulfillment_date + * + * @return \DateTime + */ + public function getFulfillmentDate() + { + return $this->container['fulfillment_date']; + } + + /** + * Sets fulfillment_date + * + * @param \DateTime $fulfillment_date fulfillment_date + * + * @return self + */ + public function setFulfillmentDate($fulfillment_date) + { + if (is_null($fulfillment_date)) { + throw new \InvalidArgumentException('non-nullable fulfillment_date cannot be null'); + } + $this->container['fulfillment_date'] = $fulfillment_date; + + return $this; + } + + /** + * Gets paid_at + * + * @return \DateTime|null + */ + public function getPaidAt() + { + return $this->container['paid_at']; + } + + /** + * Sets paid_at + * + * @param \DateTime|null $paid_at paid_at + * + * @return self + */ + public function setPaidAt($paid_at) + { + if (is_null($paid_at)) { + throw new \InvalidArgumentException('non-nullable paid_at cannot be null'); + } + $this->container['paid_at'] = $paid_at; + + return $this; + } + + /** + * Gets category + * + * @return \Cone\Billingo\Model\Category + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param \Cone\Billingo\Model\Category $category category + * + * @return self + */ + public function setCategory($category) + { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets comment + * + * @return string|null + */ + public function getComment() + { + return $this->container['comment']; + } + + /** + * Sets comment + * + * @param string|null $comment comment + * + * @return self + */ + public function setComment($comment) + { + if (is_null($comment)) { + throw new \InvalidArgumentException('non-nullable comment cannot be null'); + } + $this->container['comment'] = $comment; + + return $this; + } + + /** + * Gets invoice_number + * + * @return string|null + */ + public function getInvoiceNumber() + { + return $this->container['invoice_number']; + } + + /** + * Sets invoice_number + * + * @param string|null $invoice_number invoice_number + * + * @return self + */ + public function setInvoiceNumber($invoice_number) + { + if (is_null($invoice_number)) { + throw new \InvalidArgumentException('non-nullable invoice_number cannot be null'); + } + $this->container['invoice_number'] = $invoice_number; + + return $this; + } + + /** + * Gets invoice_date + * + * @return \DateTime|null + */ + public function getInvoiceDate() + { + return $this->container['invoice_date']; + } + + /** + * Sets invoice_date + * + * @param \DateTime|null $invoice_date invoice_date + * + * @return self + */ + public function setInvoiceDate($invoice_date) + { + if (is_null($invoice_date)) { + throw new \InvalidArgumentException('non-nullable invoice_date cannot be null'); + } + $this->container['invoice_date'] = $invoice_date; + + return $this; + } + + /** + * Gets due_date + * + * @return \DateTime|null + */ + public function getDueDate() + { + return $this->container['due_date']; + } + + /** + * Sets due_date + * + * @param \DateTime|null $due_date due_date + * + * @return self + */ + public function setDueDate($due_date) + { + if (is_null($due_date)) { + throw new \InvalidArgumentException('non-nullable due_date cannot be null'); + } + $this->container['due_date'] = $due_date; + + return $this; + } + + /** + * Gets payment_method + * + * @return \Cone\Billingo\Model\SpendingPaymentMethod + */ + public function getPaymentMethod() + { + return $this->container['payment_method']; + } + + /** + * Sets payment_method + * + * @param \Cone\Billingo\Model\SpendingPaymentMethod $payment_method payment_method + * + * @return self + */ + public function setPaymentMethod($payment_method) + { + if (is_null($payment_method)) { + throw new \InvalidArgumentException('non-nullable payment_method cannot be null'); + } + $this->container['payment_method'] = $payment_method; + + return $this; + } + + /** + * Gets partner_id + * + * @return int|null + */ + public function getPartnerId() + { + return $this->container['partner_id']; + } + + /** + * Sets partner_id + * + * @param int|null $partner_id partner_id + * + * @return self + */ + public function setPartnerId($partner_id) + { + if (is_null($partner_id)) { + throw new \InvalidArgumentException('non-nullable partner_id cannot be null'); + } + $this->container['partner_id'] = $partner_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Subscription.php b/lib/Model/Subscription.php new file mode 100644 index 0000000..0adfd7a --- /dev/null +++ b/lib/Model/Subscription.php @@ -0,0 +1,444 @@ + + */ +class Subscription implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Subscription'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'expiration_date' => '\DateTime', + 'features' => '\Cone\Billingo\Model\Feature[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'expiration_date' => 'date', + 'features' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'expiration_date' => false, + 'features' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'expiration_date' => 'expiration_date', + 'features' => 'features' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'expiration_date' => 'setExpirationDate', + 'features' => 'setFeatures' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'expiration_date' => 'getExpirationDate', + 'features' => 'getFeatures' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('expiration_date', $data ?? [], null); + $this->setIfExists('features', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets expiration_date + * + * @return \DateTime|null + */ + public function getExpirationDate() + { + return $this->container['expiration_date']; + } + + /** + * Sets expiration_date + * + * @param \DateTime|null $expiration_date expiration_date + * + * @return self + */ + public function setExpirationDate($expiration_date) + { + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } + $this->container['expiration_date'] = $expiration_date; + + return $this; + } + + /** + * Gets features + * + * @return \Cone\Billingo\Model\Feature[]|null + */ + public function getFeatures() + { + return $this->container['features']; + } + + /** + * Sets features + * + * @param \Cone\Billingo\Model\Feature[]|null $features features + * + * @return self + */ + public function setFeatures($features) + { + if (is_null($features)) { + throw new \InvalidArgumentException('non-nullable features cannot be null'); + } + $this->container['features'] = $features; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SubscriptionErrorResponse.php b/lib/Model/SubscriptionErrorResponse.php new file mode 100644 index 0000000..8616709 --- /dev/null +++ b/lib/Model/SubscriptionErrorResponse.php @@ -0,0 +1,410 @@ + + */ +class SubscriptionErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubscriptionErrorResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'error' => '\Cone\Billingo\Model\ClientError' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'error' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'error' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'error' => 'error' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'error' => 'setError' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'error' => 'getError' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('error', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets error + * + * @return \Cone\Billingo\Model\ClientError|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param \Cone\Billingo\Model\ClientError|null $error error + * + * @return self + */ + public function setError($error) + { + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/TaxNumber.php b/lib/Model/TaxNumber.php new file mode 100644 index 0000000..b9087f0 --- /dev/null +++ b/lib/Model/TaxNumber.php @@ -0,0 +1,444 @@ + + */ +class TaxNumber implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TaxNumber'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'tax_number' => 'string', + 'result' => '\Cone\Billingo\Model\CheckTaxNumberMessage' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'tax_number' => null, + 'result' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tax_number' => false, + 'result' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tax_number' => 'tax_number', + 'result' => 'result' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tax_number' => 'setTaxNumber', + 'result' => 'setResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tax_number' => 'getTaxNumber', + 'result' => 'getResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('tax_number', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets tax_number + * + * @return string|null + */ + public function getTaxNumber() + { + return $this->container['tax_number']; + } + + /** + * Sets tax_number + * + * @param string|null $tax_number tax_number + * + * @return self + */ + public function setTaxNumber($tax_number) + { + if (is_null($tax_number)) { + throw new \InvalidArgumentException('non-nullable tax_number cannot be null'); + } + $this->container['tax_number'] = $tax_number; + + return $this; + } + + /** + * Gets result + * + * @return \Cone\Billingo\Model\CheckTaxNumberMessage|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \Cone\Billingo\Model\CheckTaxNumberMessage|null $result result + * + * @return self + */ + public function setResult($result) + { + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); + } + $this->container['result'] = $result; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/TooManyRequestsResponse.php b/lib/Model/TooManyRequestsResponse.php new file mode 100644 index 0000000..ea6d469 --- /dev/null +++ b/lib/Model/TooManyRequestsResponse.php @@ -0,0 +1,410 @@ + + */ +class TooManyRequestsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TooManyRequestsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'error' => '\Cone\Billingo\Model\ClientError' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'error' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'error' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'error' => 'error' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'error' => 'setError' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'error' => 'getError' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('error', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets error + * + * @return \Cone\Billingo\Model\ClientError|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param \Cone\Billingo\Model\ClientError|null $error error + * + * @return self + */ + public function setError($error) + { + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UnitPriceType.php b/lib/Model/UnitPriceType.php new file mode 100644 index 0000000..7cf5c38 --- /dev/null +++ b/lib/Model/UnitPriceType.php @@ -0,0 +1,63 @@ + + */ +class ValidationError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ValidationError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'field' => 'string', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'field' => null, + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'field' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'field' => 'field', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'field' => 'setField', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'field' => 'getField', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('field', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets field + * + * @return string|null + */ + public function getField() + { + return $this->container['field']; + } + + /** + * Sets field + * + * @param string|null $field field + * + * @return self + */ + public function setField($field) + { + if (is_null($field)) { + throw new \InvalidArgumentException('non-nullable field cannot be null'); + } + $this->container['field'] = $field; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ValidationErrorResponse.php b/lib/Model/ValidationErrorResponse.php new file mode 100644 index 0000000..b868207 --- /dev/null +++ b/lib/Model/ValidationErrorResponse.php @@ -0,0 +1,444 @@ + + */ +class ValidationErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ValidationErrorResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + 'errors' => '\Cone\Billingo\Model\ValidationError[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + 'errors' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'message' => false, + 'errors' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + 'errors' => 'errors' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + 'errors' => 'setErrors' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + 'errors' => 'getErrors' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets errors + * + * @return \Cone\Billingo\Model\ValidationError[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \Cone\Billingo\Model\ValidationError[]|null $errors errors + * + * @return self + */ + public function setErrors($errors) + { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Vat.php b/lib/Model/Vat.php new file mode 100644 index 0000000..2a81434 --- /dev/null +++ b/lib/Model/Vat.php @@ -0,0 +1,183 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) return $timestamp; + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue($value) + { + return rawurlencode(self::toString($value)); + } + + /** + * Checks if a value is empty, based on its OpenAPI type. + * + * @param mixed $value + * @param string $openApiType + * + * @return bool true if $value is empty + */ + private static function isEmptyValue($value, string $openApiType): bool + { + # If empty() returns false, it is not empty regardless of its type. + if (!empty($value)) { + return false; + } + + # Null is always empty, as we cannot send a real "null" value in a query parameter. + if ($value === null) { + return true; + } + + switch ($openApiType) { + # For numeric values, false and '' are considered empty. + # This comparison is safe for floating point values, since the previous call to empty() will + # filter out values that don't match 0. + case 'int': + case 'integer': + return $value !== 0; + + case 'number': + case 'float': + return $value !== 0 && $value !== 0.0; + + # For boolean values, '' is considered empty + case 'bool': + case 'boolean': + return !in_array($value, [false, 0], true); + + # For all the other types, any value at this point can be considered empty. + default: + return true; + } + } + + /** + * Take query parameter properties and turn it into an array suitable for + * native http_build_query or GuzzleHttp\Psr7\Query::build. + * + * @param mixed $value Parameter value + * @param string $paramName Parameter name + * @param string $openApiType OpenAPIType eg. array or object + * @param string $style Parameter serialization style + * @param bool $explode Parameter explode option + * @param bool $required Whether query param is required or not + * + * @return array + */ + public static function toQueryValue( + $value, + string $paramName, + string $openApiType = 'string', + string $style = 'form', + bool $explode = true, + bool $required = true + ): array { + + # Check if we should omit this parameter from the query. This should only happen when: + # - Parameter is NOT required; AND + # - its value is set to a value that is equivalent to "empty", depending on its OpenAPI type. For + # example, 0 as "int" or "boolean" is NOT an empty value. + if (self::isEmptyValue($value, $openApiType)) { + if ($required) { + return ["{$paramName}" => '']; + } else { + return []; + } + } + + # Handle DateTime objects in query + if($openApiType === "\\DateTime" && $value instanceof \DateTime) { + return ["{$paramName}" => $value->format(self::$dateTimeFormat)]; + } + + $query = []; + $value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value; + + // since \GuzzleHttp\Psr7\Query::build fails with nested arrays + // need to flatten array first + $flattenArray = function ($arr, $name, &$result = []) use (&$flattenArray, $style, $explode) { + if (!is_array($arr)) return $arr; + + foreach ($arr as $k => $v) { + $prop = ($style === 'deepObject') ? $prop = "{$name}[{$k}]" : $k; + + if (is_array($v)) { + $flattenArray($v, $prop, $result); + } else { + if ($style !== 'deepObject' && !$explode) { + // push key itself + $result[] = $prop; + } + $result[$prop] = $v; + } + } + return $result; + }; + + $value = $flattenArray($value, $paramName); + + if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) { + return $value; + } + + if ('boolean' === $openApiType && is_bool($value)) { + $value = self::convertBoolToQueryStringFormat($value); + } + + // handle style in serializeCollection + $query[$paramName] = ($explode) ? $value : self::serializeCollection((array)$value, $style); + + return $query; + } + + /** + * Convert boolean value to format for query string. + * + * @param bool $value Boolean value + * + * @return int|string Boolean value in format + */ + public static function convertBoolToQueryStringFormat(bool $value) + { + if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { + return $value ? 'true' : 'false'; + } + + return (int) $value; + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue($value) + { + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); + } + + return self::toString($value); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\SplFileObject $value the value of the form parameter + * + * @return string the form string + */ + public static function toFormValue($value) + { + if ($value instanceof \SplFileObject) { + return $value->getRealPath(); + } else { + return self::toString($value); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * If it's a boolean, convert it to "true" or "false". + * + * @param string|bool|\DateTime $value the value of the parameter + * + * @return string the header string + */ + public static function toString($value) + { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(self::$dateTimeFormat); + } elseif (is_bool($value)) { + return $value ? 'true' : 'false'; + } else { + return (string) $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if ( + is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Cone\Billingo\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } + + /** + * Native `http_build_query` wrapper. + * @see https://www.php.net/manual/en/function.http-build-query + * + * @param array|object $data May be an array or object containing properties. + * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. + * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. + * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. + * + * @return string + */ + public static function buildQuery( + $data, + string $numeric_prefix = '', + ?string $arg_separator = null, + int $encoding_type = \PHP_QUERY_RFC3986 + ): string { + return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + } +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..485899a --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,18 @@ + + + + + ./lib/Api + ./lib/Model + + + + + ./test/Api + ./test/Model + + + + + + diff --git a/test/Api/BankAccountApiTest.php b/test/Api/BankAccountApiTest.php new file mode 100644 index 0000000..16db467 --- /dev/null +++ b/test/Api/BankAccountApiTest.php @@ -0,0 +1,134 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteBankAccount + * + * Delete a bank account. + * + */ + public function testDeleteBankAccount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getBankAccount + * + * Retrieve a bank account. + * + */ + public function testGetBankAccount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listBankAccount + * + * List all bank account. + * + */ + public function testListBankAccount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for updateBankAccount + * + * Update a bank account. + * + */ + public function testUpdateBankAccount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/CurrencyApiTest.php b/test/Api/CurrencyApiTest.php new file mode 100644 index 0000000..a949142 --- /dev/null +++ b/test/Api/CurrencyApiTest.php @@ -0,0 +1,86 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/DocumentApiTest.php b/test/Api/DocumentApiTest.php new file mode 100644 index 0000000..ca4ace3 --- /dev/null +++ b/test/Api/DocumentApiTest.php @@ -0,0 +1,326 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for cancelDocument + * + * Cancel a document. + * + */ + public function testCancelDocument() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for createDocument + * + * Create a document. + * + */ + public function testCreateDocument() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for createDocumentFromDraft + * + * Converts a draft to an invoice.. + * + */ + public function testCreateDocumentFromDraft() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for createDocumentFromProforma + * + * Create a document from proforma.. + * + */ + public function testCreateDocumentFromProforma() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for createModificationDocument + * + * Create a modification document.. + * + */ + public function testCreateModificationDocument() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for createReceipt + * + * Create a receipt. + * + */ + public function testCreateReceipt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for createReceiptFromDraft + * + * Converts a draft to a receipt.. + * + */ + public function testCreateReceiptFromDraft() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteDocument + * + * Delete a draft.. + * + */ + public function testDeleteDocument() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deletePayment + * + * Delete all payment history on document. + * + */ + public function testDeletePayment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for documentCopy + * + * Copy a document. + * + */ + public function testDocumentCopy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for downloadDocument + * + * Download a document in PDF format.. + * + */ + public function testDownloadDocument() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getDocument + * + * Retrieve a document. + * + */ + public function testGetDocument() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getDocumentByVendorId + * + * Retrieve a document by vendor id. + * + */ + public function testGetDocumentByVendorId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getOnlineSzamlaStatus + * + * Retrieve a document Online Számla status. + * + */ + public function testGetOnlineSzamlaStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getPayment + * + * Retrieve a payment histroy. + * + */ + public function testGetPayment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getPublicUrl + * + * Retrieve a document download public url.. + * + */ + public function testGetPublicUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listDocument + * + * List all documents. + * + */ + public function testListDocument() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for posPrint + * + * Returns a printable POS PDF. + * + */ + public function testPosPrint() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for sendDocument + * + * Send invoice to given email adresses.. + * + */ + public function testSendDocument() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for updatePayment + * + * Update payment history. + * + */ + public function testUpdatePayment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/DocumentExportApiTest.php b/test/Api/DocumentExportApiTest.php new file mode 100644 index 0000000..4318e73 --- /dev/null +++ b/test/Api/DocumentExportApiTest.php @@ -0,0 +1,110 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for download + * + * Return exported binary file.. + * + */ + public function testDownload() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for poll + * + * Retrieve export state.. + * + */ + public function testPoll() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/InventoryApiTest.php b/test/Api/InventoryApiTest.php new file mode 100644 index 0000000..77be386 --- /dev/null +++ b/test/Api/InventoryApiTest.php @@ -0,0 +1,86 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/OrganizationApiTest.php b/test/Api/OrganizationApiTest.php new file mode 100644 index 0000000..967fade --- /dev/null +++ b/test/Api/OrganizationApiTest.php @@ -0,0 +1,86 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/PartnerApiTest.php b/test/Api/PartnerApiTest.php new file mode 100644 index 0000000..ca14816 --- /dev/null +++ b/test/Api/PartnerApiTest.php @@ -0,0 +1,98 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for listPartner + * + * List all partners. + * + */ + public function testListPartner() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/ProductApiTest.php b/test/Api/ProductApiTest.php new file mode 100644 index 0000000..63a05ff --- /dev/null +++ b/test/Api/ProductApiTest.php @@ -0,0 +1,134 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteProduct + * + * Delete a product. + * + */ + public function testDeleteProduct() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getProduct + * + * Retrieve a product. + * + */ + public function testGetProduct() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listProduct + * + * List all product. + * + */ + public function testListProduct() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for updateProduct + * + * Update a product. + * + */ + public function testUpdateProduct() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/SpendingApiTest.php b/test/Api/SpendingApiTest.php new file mode 100644 index 0000000..fd13063 --- /dev/null +++ b/test/Api/SpendingApiTest.php @@ -0,0 +1,134 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for spendingList + * + * Lists all spending. + * + */ + public function testSpendingList() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for spendingSave + * + * Creates a new spending.. + * + */ + public function testSpendingSave() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for spendingShow + * + * Retrieves one specific spending.. + * + */ + public function testSpendingShow() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for spendingUpdate + * + * Updates a spending item.. + * + */ + public function testSpendingUpdate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Api/UtilApiTest.php b/test/Api/UtilApiTest.php new file mode 100644 index 0000000..5f4f22d --- /dev/null +++ b/test/Api/UtilApiTest.php @@ -0,0 +1,110 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for getId + * + * Convert legacy ID to v3 ID.. + * + */ + public function testGetId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getServerTime + * + * Get the server time. + * + */ + public function testGetServerTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/AddressTest.php b/test/Model/AddressTest.php new file mode 100644 index 0000000..f7f2997 --- /dev/null +++ b/test/Model/AddressTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "country_code" + */ + public function testPropertyCountryCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "post_code" + */ + public function testPropertyPostCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "city" + */ + public function testPropertyCity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "address" + */ + public function testPropertyAddress() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/BankAccountListTest.php b/test/Model/BankAccountListTest.php new file mode 100644 index 0000000..0d4d368 --- /dev/null +++ b/test/Model/BankAccountListTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total" + */ + public function testPropertyTotal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "per_page" + */ + public function testPropertyPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "current_page" + */ + public function testPropertyCurrentPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_page" + */ + public function testPropertyLastPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_page_url" + */ + public function testPropertyPrevPageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_page_url" + */ + public function testPropertyNextPageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/BankAccountTest.php b/test/Model/BankAccountTest.php new file mode 100644 index 0000000..e7db1fb --- /dev/null +++ b/test/Model/BankAccountTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "account_number" + */ + public function testPropertyAccountNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "account_number_iban" + */ + public function testPropertyAccountNumberIban() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "swift" + */ + public function testPropertySwift() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currency" + */ + public function testPropertyCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "need_qr" + */ + public function testPropertyNeedQr() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CategoryTest.php b/test/Model/CategoryTest.php new file mode 100644 index 0000000..817bd8b --- /dev/null +++ b/test/Model/CategoryTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CheckTaxNumberMessageTest.php b/test/Model/CheckTaxNumberMessageTest.php new file mode 100644 index 0000000..124f067 --- /dev/null +++ b/test/Model/CheckTaxNumberMessageTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ClientErrorResponseTest.php b/test/Model/ClientErrorResponseTest.php new file mode 100644 index 0000000..bbdfc5e --- /dev/null +++ b/test/Model/ClientErrorResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ClientErrorTest.php b/test/Model/ClientErrorTest.php new file mode 100644 index 0000000..64fd083 --- /dev/null +++ b/test/Model/ClientErrorTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ConversationRateTest.php b/test/Model/ConversationRateTest.php new file mode 100644 index 0000000..915a52c --- /dev/null +++ b/test/Model/ConversationRateTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "from_currency" + */ + public function testPropertyFromCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "to_currency" + */ + public function testPropertyToCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conversation_rate" + */ + public function testPropertyConversationRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "date" + */ + public function testPropertyDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CorrectionTypeTest.php b/test/Model/CorrectionTypeTest.php new file mode 100644 index 0000000..db6e7bc --- /dev/null +++ b/test/Model/CorrectionTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CountryTest.php b/test/Model/CountryTest.php new file mode 100644 index 0000000..aa10f16 --- /dev/null +++ b/test/Model/CountryTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateDocumentExportTest.php b/test/Model/CreateDocumentExportTest.php new file mode 100644 index 0000000..9bc0110 --- /dev/null +++ b/test/Model/CreateDocumentExportTest.php @@ -0,0 +1,199 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query_type" + */ + public function testPropertyQueryType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "start_date" + */ + public function testPropertyStartDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "end_date" + */ + public function testPropertyEndDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "document_block_id" + */ + public function testPropertyDocumentBlockId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "export_type" + */ + public function testPropertyExportType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "number_start_year" + */ + public function testPropertyNumberStartYear() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "number_start_sequence" + */ + public function testPropertyNumberStartSequence() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "number_end_year" + */ + public function testPropertyNumberEndYear() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "number_end_sequence" + */ + public function testPropertyNumberEndSequence() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sort_by" + */ + public function testPropertySortBy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "other_options" + */ + public function testPropertyOtherOptions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filter_extra" + */ + public function testPropertyFilterExtra() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CurrencyTest.php b/test/Model/CurrencyTest.php new file mode 100644 index 0000000..b729b4c --- /dev/null +++ b/test/Model/CurrencyTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DateTypeTest.php b/test/Model/DateTypeTest.php new file mode 100644 index 0000000..e2f5588 --- /dev/null +++ b/test/Model/DateTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DiscountTest.php b/test/Model/DiscountTest.php new file mode 100644 index 0000000..a1789ac --- /dev/null +++ b/test/Model/DiscountTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DiscountTypeTest.php b/test/Model/DiscountTypeTest.php new file mode 100644 index 0000000..17ee2df --- /dev/null +++ b/test/Model/DiscountTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentAncestorTest.php b/test/Model/DocumentAncestorTest.php new file mode 100644 index 0000000..9b656ac --- /dev/null +++ b/test/Model/DocumentAncestorTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "invoice_number" + */ + public function testPropertyInvoiceNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentBankAccountTest.php b/test/Model/DocumentBankAccountTest.php new file mode 100644 index 0000000..5945666 --- /dev/null +++ b/test/Model/DocumentBankAccountTest.php @@ -0,0 +1,127 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "account_number" + */ + public function testPropertyAccountNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "account_number_iban" + */ + public function testPropertyAccountNumberIban() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "swift" + */ + public function testPropertySwift() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentBlockListTest.php b/test/Model/DocumentBlockListTest.php new file mode 100644 index 0000000..bc25aeb --- /dev/null +++ b/test/Model/DocumentBlockListTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total" + */ + public function testPropertyTotal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "per_page" + */ + public function testPropertyPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "current_page" + */ + public function testPropertyCurrentPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_page" + */ + public function testPropertyLastPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_page_url" + */ + public function testPropertyPrevPageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_page_url" + */ + public function testPropertyNextPageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentBlockTest.php b/test/Model/DocumentBlockTest.php new file mode 100644 index 0000000..3b490c6 --- /dev/null +++ b/test/Model/DocumentBlockTest.php @@ -0,0 +1,136 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prefix" + */ + public function testPropertyPrefix() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom_field1" + */ + public function testPropertyCustomField1() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom_field2" + */ + public function testPropertyCustomField2() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentBlockTypeTest.php b/test/Model/DocumentBlockTypeTest.php new file mode 100644 index 0000000..08623e6 --- /dev/null +++ b/test/Model/DocumentBlockTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentCancellationTest.php b/test/Model/DocumentCancellationTest.php new file mode 100644 index 0000000..4ccb037 --- /dev/null +++ b/test/Model/DocumentCancellationTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cancellation_reason" + */ + public function testPropertyCancellationReason() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cancellation_recipients" + */ + public function testPropertyCancellationRecipients() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentExportFilterExtraTest.php b/test/Model/DocumentExportFilterExtraTest.php new file mode 100644 index 0000000..284e9a4 --- /dev/null +++ b/test/Model/DocumentExportFilterExtraTest.php @@ -0,0 +1,163 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tensoft_vkod" + */ + public function testPropertyTensoftVkod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ledger_number" + */ + public function testPropertyLedgerNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "forintsoft_konyvelesi_naplo_szam" + */ + public function testPropertyForintsoftKonyvelesiNaploSzam() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "positive_ledger_number" + */ + public function testPropertyPositiveLedgerNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "negative_ledger_number" + */ + public function testPropertyNegativeLedgerNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "rlb_kata" + */ + public function testPropertyRlbKata() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "rlb_note" + */ + public function testPropertyRlbNote() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "novitax_naplokod" + */ + public function testPropertyNovitaxNaplokod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "use_gross_values" + */ + public function testPropertyUseGrossValues() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentExportIdTest.php b/test/Model/DocumentExportIdTest.php new file mode 100644 index 0000000..376feab --- /dev/null +++ b/test/Model/DocumentExportIdTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentExportOtherOptionsTest.php b/test/Model/DocumentExportOtherOptionsTest.php new file mode 100644 index 0000000..7ec34ac --- /dev/null +++ b/test/Model/DocumentExportOtherOptionsTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentExportQueryTypeTest.php b/test/Model/DocumentExportQueryTypeTest.php new file mode 100644 index 0000000..976b750 --- /dev/null +++ b/test/Model/DocumentExportQueryTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentExportSortByTest.php b/test/Model/DocumentExportSortByTest.php new file mode 100644 index 0000000..ea797b4 --- /dev/null +++ b/test/Model/DocumentExportSortByTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentExportStatusStateTest.php b/test/Model/DocumentExportStatusStateTest.php new file mode 100644 index 0000000..4bfa6e1 --- /dev/null +++ b/test/Model/DocumentExportStatusStateTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentExportStatusTest.php b/test/Model/DocumentExportStatusTest.php new file mode 100644 index 0000000..cf03846 --- /dev/null +++ b/test/Model/DocumentExportStatusTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "state" + */ + public function testPropertyState() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentExportTypeTest.php b/test/Model/DocumentExportTypeTest.php new file mode 100644 index 0000000..13f1800 --- /dev/null +++ b/test/Model/DocumentExportTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentFormTest.php b/test/Model/DocumentFormTest.php new file mode 100644 index 0000000..25ed1d5 --- /dev/null +++ b/test/Model/DocumentFormTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentFormatTest.php b/test/Model/DocumentFormatTest.php new file mode 100644 index 0000000..03259b7 --- /dev/null +++ b/test/Model/DocumentFormatTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentInsertInstantPaymentRequestTest.php b/test/Model/DocumentInsertInstantPaymentRequestTest.php new file mode 100644 index 0000000..6a1e925 --- /dev/null +++ b/test/Model/DocumentInsertInstantPaymentRequestTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "debtor_bank_account" + */ + public function testPropertyDebtorBankAccount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "different_amount_allowed" + */ + public function testPropertyDifferentAmountAllowed() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "update_partner_payment_details" + */ + public function testPropertyUpdatePartnerPaymentDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentInsertItemsInnerTest.php b/test/Model/DocumentInsertItemsInnerTest.php new file mode 100644 index 0000000..8a2dca9 --- /dev/null +++ b/test/Model/DocumentInsertItemsInnerTest.php @@ -0,0 +1,172 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "product_id" + */ + public function testPropertyProductId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "quantity" + */ + public function testPropertyQuantity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "comment" + */ + public function testPropertyComment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unit_price" + */ + public function testPropertyUnitPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unit_price_type" + */ + public function testPropertyUnitPriceType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unit" + */ + public function testPropertyUnit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat" + */ + public function testPropertyVat() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entitlement" + */ + public function testPropertyEntitlement() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sku" + */ + public function testPropertySku() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentInsertTest.php b/test/Model/DocumentInsertTest.php new file mode 100644 index 0000000..f7eabe8 --- /dev/null +++ b/test/Model/DocumentInsertTest.php @@ -0,0 +1,262 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vendor_id" + */ + public function testPropertyVendorId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "partner_id" + */ + public function testPropertyPartnerId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "block_id" + */ + public function testPropertyBlockId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bank_account_id" + */ + public function testPropertyBankAccountId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fulfillment_date" + */ + public function testPropertyFulfillmentDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "due_date" + */ + public function testPropertyDueDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "language" + */ + public function testPropertyLanguage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currency" + */ + public function testPropertyCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conversion_rate" + */ + public function testPropertyConversionRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "electronic" + */ + public function testPropertyElectronic() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "paid" + */ + public function testPropertyPaid() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "items" + */ + public function testPropertyItems() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "comment" + */ + public function testPropertyComment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "settings" + */ + public function testPropertySettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "advance_invoice" + */ + public function testPropertyAdvanceInvoice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "discount" + */ + public function testPropertyDiscount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "instant_payment" + */ + public function testPropertyInstantPayment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "instant_payment_request" + */ + public function testPropertyInstantPaymentRequest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentInsertTypeTest.php b/test/Model/DocumentInsertTypeTest.php new file mode 100644 index 0000000..c1260dc --- /dev/null +++ b/test/Model/DocumentInsertTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentInstantPaymentRequestTest.php b/test/Model/DocumentInstantPaymentRequestTest.php new file mode 100644 index 0000000..74a1c6f --- /dev/null +++ b/test/Model/DocumentInstantPaymentRequestTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "debtor_bank_account" + */ + public function testPropertyDebtorBankAccount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "different_amount_allowed" + */ + public function testPropertyDifferentAmountAllowed() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "update_partner_payment_details" + */ + public function testPropertyUpdatePartnerPaymentDetails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentItemDataTest.php b/test/Model/DocumentItemDataTest.php new file mode 100644 index 0000000..5223958 --- /dev/null +++ b/test/Model/DocumentItemDataTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "product_id" + */ + public function testPropertyProductId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "quantity" + */ + public function testPropertyQuantity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "comment" + */ + public function testPropertyComment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentItemTest.php b/test/Model/DocumentItemTest.php new file mode 100644 index 0000000..c1fb4dc --- /dev/null +++ b/test/Model/DocumentItemTest.php @@ -0,0 +1,190 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "product_id" + */ + public function testPropertyProductId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_unit_amount" + */ + public function testPropertyNetUnitAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "quantity" + */ + public function testPropertyQuantity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unit" + */ + public function testPropertyUnit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_amount" + */ + public function testPropertyNetAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "gross_amount" + */ + public function testPropertyGrossAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat" + */ + public function testPropertyVat() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat_amount" + */ + public function testPropertyVatAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entitlement" + */ + public function testPropertyEntitlement() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "comment" + */ + public function testPropertyComment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sku" + */ + public function testPropertySku() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentLanguageTest.php b/test/Model/DocumentLanguageTest.php new file mode 100644 index 0000000..eee1f48 --- /dev/null +++ b/test/Model/DocumentLanguageTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentListTest.php b/test/Model/DocumentListTest.php new file mode 100644 index 0000000..21742cd --- /dev/null +++ b/test/Model/DocumentListTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total" + */ + public function testPropertyTotal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "per_page" + */ + public function testPropertyPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "current_page" + */ + public function testPropertyCurrentPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_page" + */ + public function testPropertyLastPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_page_url" + */ + public function testPropertyPrevPageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_page_url" + */ + public function testPropertyNextPageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentNotificationStatusTest.php b/test/Model/DocumentNotificationStatusTest.php new file mode 100644 index 0000000..d0147b3 --- /dev/null +++ b/test/Model/DocumentNotificationStatusTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentOrganizationTest.php b/test/Model/DocumentOrganizationTest.php new file mode 100644 index 0000000..b9d1e4f --- /dev/null +++ b/test/Model/DocumentOrganizationTest.php @@ -0,0 +1,154 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tax_number" + */ + public function testPropertyTaxNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bank_account" + */ + public function testPropertyBankAccount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "address" + */ + public function testPropertyAddress() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "small_taxpayer" + */ + public function testPropertySmallTaxpayer() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ev_number" + */ + public function testPropertyEvNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "eu_tax_number" + */ + public function testPropertyEuTaxNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cash_settled" + */ + public function testPropertyCashSettled() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentPartnerPartnerShippingTest.php b/test/Model/DocumentPartnerPartnerShippingTest.php new file mode 100644 index 0000000..8248091 --- /dev/null +++ b/test/Model/DocumentPartnerPartnerShippingTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "match" + */ + public function testPropertyMatch() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mode" + */ + public function testPropertyMode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "address" + */ + public function testPropertyAddress() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentPartnerTest.php b/test/Model/DocumentPartnerTest.php new file mode 100644 index 0000000..5b3e900 --- /dev/null +++ b/test/Model/DocumentPartnerTest.php @@ -0,0 +1,181 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "address" + */ + public function testPropertyAddress() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "emails" + */ + public function testPropertyEmails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "taxcode" + */ + public function testPropertyTaxcode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iban" + */ + public function testPropertyIban() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "swift" + */ + public function testPropertySwift() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "account_number" + */ + public function testPropertyAccountNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phone" + */ + public function testPropertyPhone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tax_type" + */ + public function testPropertyTaxType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "partner_shipping" + */ + public function testPropertyPartnerShipping() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentProductDataTest.php b/test/Model/DocumentProductDataTest.php new file mode 100644 index 0000000..36fee70 --- /dev/null +++ b/test/Model/DocumentProductDataTest.php @@ -0,0 +1,163 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unit_price" + */ + public function testPropertyUnitPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unit_price_type" + */ + public function testPropertyUnitPriceType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "quantity" + */ + public function testPropertyQuantity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unit" + */ + public function testPropertyUnit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat" + */ + public function testPropertyVat() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "comment" + */ + public function testPropertyComment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entitlement" + */ + public function testPropertyEntitlement() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sku" + */ + public function testPropertySku() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentPublicUrlTest.php b/test/Model/DocumentPublicUrlTest.php new file mode 100644 index 0000000..d58d49d --- /dev/null +++ b/test/Model/DocumentPublicUrlTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "public_url" + */ + public function testPropertyPublicUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentSettingsDontSendToNavReasonTest.php b/test/Model/DocumentSettingsDontSendToNavReasonTest.php new file mode 100644 index 0000000..6c89679 --- /dev/null +++ b/test/Model/DocumentSettingsDontSendToNavReasonTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentSettingsTest.php b/test/Model/DocumentSettingsTest.php new file mode 100644 index 0000000..3cc0387 --- /dev/null +++ b/test/Model/DocumentSettingsTest.php @@ -0,0 +1,190 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mediated_service" + */ + public function testPropertyMediatedService() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "without_financial_fulfillment" + */ + public function testPropertyWithoutFinancialFulfillment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "online_payment" + */ + public function testPropertyOnlinePayment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "should_send_email" + */ + public function testPropertyShouldSendEmail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "round" + */ + public function testPropertyRound() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "no_send_onlineszamla_by_user" + */ + public function testPropertyNoSendOnlineszamlaByUser() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "dont_send_to_nav_reason" + */ + public function testPropertyDontSendToNavReason() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "order_number" + */ + public function testPropertyOrderNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "place_id" + */ + public function testPropertyPlaceId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "instant_payment" + */ + public function testPropertyInstantPayment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "selected_type" + */ + public function testPropertySelectedType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "instant_payment_request" + */ + public function testPropertyInstantPaymentRequest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentSummaryTest.php b/test/Model/DocumentSummaryTest.php new file mode 100644 index 0000000..89f0f0d --- /dev/null +++ b/test/Model/DocumentSummaryTest.php @@ -0,0 +1,136 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_amount" + */ + public function testPropertyNetAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_amount_local" + */ + public function testPropertyNetAmountLocal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "gross_amount_local" + */ + public function testPropertyGrossAmountLocal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat_amount" + */ + public function testPropertyVatAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat_amount_local" + */ + public function testPropertyVatAmountLocal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat_rate_summary" + */ + public function testPropertyVatRateSummary() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentTest.php b/test/Model/DocumentTest.php new file mode 100644 index 0000000..fd3c0fe --- /dev/null +++ b/test/Model/DocumentTest.php @@ -0,0 +1,352 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "invoice_number" + */ + public function testPropertyInvoiceNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cancelled" + */ + public function testPropertyCancelled() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "block_id" + */ + public function testPropertyBlockId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_status" + */ + public function testPropertyPaymentStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "gross_total" + */ + public function testPropertyGrossTotal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currency" + */ + public function testPropertyCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conversion_rate" + */ + public function testPropertyConversionRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "invoice_date" + */ + public function testPropertyInvoiceDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fulfillment_date" + */ + public function testPropertyFulfillmentDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "due_date" + */ + public function testPropertyDueDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "paid_date" + */ + public function testPropertyPaidDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "organization" + */ + public function testPropertyOrganization() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "partner" + */ + public function testPropertyPartner() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "document_partner" + */ + public function testPropertyDocumentPartner() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "electronic" + */ + public function testPropertyElectronic() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "comment" + */ + public function testPropertyComment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tags" + */ + public function testPropertyTags() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "notification_status" + */ + public function testPropertyNotificationStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "language" + */ + public function testPropertyLanguage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "items" + */ + public function testPropertyItems() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "summary" + */ + public function testPropertySummary() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "settings" + */ + public function testPropertySettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "online_szamla_status" + */ + public function testPropertyOnlineSzamlaStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "related_documents" + */ + public function testPropertyRelatedDocuments() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "discount" + */ + public function testPropertyDiscount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "correction_type" + */ + public function testPropertyCorrectionType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "recurring_id" + */ + public function testPropertyRecurringId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentTypeTest.php b/test/Model/DocumentTypeTest.php new file mode 100644 index 0000000..29cbacf --- /dev/null +++ b/test/Model/DocumentTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DocumentVatRateSummaryTest.php b/test/Model/DocumentVatRateSummaryTest.php new file mode 100644 index 0000000..6cf9350 --- /dev/null +++ b/test/Model/DocumentVatRateSummaryTest.php @@ -0,0 +1,136 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat_name" + */ + public function testPropertyVatName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat_percentage" + */ + public function testPropertyVatPercentage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat_rate_net_amount" + */ + public function testPropertyVatRateNetAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat_rate_vat_amount" + */ + public function testPropertyVatRateVatAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat_rate_vat_amount_local" + */ + public function testPropertyVatRateVatAmountLocal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat_rate_gross_amount" + */ + public function testPropertyVatRateGrossAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DontSendToNavReasonTest.php b/test/Model/DontSendToNavReasonTest.php new file mode 100644 index 0000000..de61b78 --- /dev/null +++ b/test/Model/DontSendToNavReasonTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EntitlementTest.php b/test/Model/EntitlementTest.php new file mode 100644 index 0000000..c8cbe2a --- /dev/null +++ b/test/Model/EntitlementTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FeatureTest.php b/test/Model/FeatureTest.php new file mode 100644 index 0000000..e17cd58 --- /dev/null +++ b/test/Model/FeatureTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/IdTest.php b/test/Model/IdTest.php new file mode 100644 index 0000000..ea21ece --- /dev/null +++ b/test/Model/IdTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "legacy_id" + */ + public function testPropertyLegacyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/InvoiceSettingsTest.php b/test/Model/InvoiceSettingsTest.php new file mode 100644 index 0000000..2f7cb64 --- /dev/null +++ b/test/Model/InvoiceSettingsTest.php @@ -0,0 +1,127 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "document_type" + */ + public function testPropertyDocumentType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fulfillment_date" + */ + public function testPropertyFulfillmentDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "due_date" + */ + public function testPropertyDueDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "document_format" + */ + public function testPropertyDocumentFormat() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "comment" + */ + public function testPropertyComment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LedgerNumberInformationTest.php b/test/Model/LedgerNumberInformationTest.php new file mode 100644 index 0000000..e19a163 --- /dev/null +++ b/test/Model/LedgerNumberInformationTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "bevetel" + */ + public function testPropertyBevetel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vevo" + */ + public function testPropertyVevo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "penztar" + */ + public function testPropertyPenztar() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "afa" + */ + public function testPropertyAfa() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ModificationDocumentInsertTest.php b/test/Model/ModificationDocumentInsertTest.php new file mode 100644 index 0000000..4f33d6f --- /dev/null +++ b/test/Model/ModificationDocumentInsertTest.php @@ -0,0 +1,127 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "due_date" + */ + public function testPropertyDueDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "comment" + */ + public function testPropertyComment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "without_financial_fulfillment" + */ + public function testPropertyWithoutFinancialFulfillment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "items" + */ + public function testPropertyItems() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MoneyTest.php b/test/Model/MoneyTest.php new file mode 100644 index 0000000..7298616 --- /dev/null +++ b/test/Model/MoneyTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "amount" + */ + public function testPropertyAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currency" + */ + public function testPropertyCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OnlinePaymentTest.php b/test/Model/OnlinePaymentTest.php new file mode 100644 index 0000000..a944258 --- /dev/null +++ b/test/Model/OnlinePaymentTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OnlineSzamlaStatusEnumTest.php b/test/Model/OnlineSzamlaStatusEnumTest.php new file mode 100644 index 0000000..02db9bd --- /dev/null +++ b/test/Model/OnlineSzamlaStatusEnumTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OnlineSzamlaStatusMessageTest.php b/test/Model/OnlineSzamlaStatusMessageTest.php new file mode 100644 index 0000000..47c9812 --- /dev/null +++ b/test/Model/OnlineSzamlaStatusMessageTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "validation_result_code" + */ + public function testPropertyValidationResultCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "validation_error_code" + */ + public function testPropertyValidationErrorCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "human_readable_message" + */ + public function testPropertyHumanReadableMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OnlineSzamlaStatusTest.php b/test/Model/OnlineSzamlaStatusTest.php new file mode 100644 index 0000000..687f1ba --- /dev/null +++ b/test/Model/OnlineSzamlaStatusTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "transaction_id" + */ + public function testPropertyTransactionId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "messages" + */ + public function testPropertyMessages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/OrganizationDataTest.php b/test/Model/OrganizationDataTest.php new file mode 100644 index 0000000..4869f23 --- /dev/null +++ b/test/Model/OrganizationDataTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tax_code" + */ + public function testPropertyTaxCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "subscription" + */ + public function testPropertySubscription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PartnerCustomBillingSettingsTest.php b/test/Model/PartnerCustomBillingSettingsTest.php new file mode 100644 index 0000000..8d50308 --- /dev/null +++ b/test/Model/PartnerCustomBillingSettingsTest.php @@ -0,0 +1,136 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "document_form" + */ + public function testPropertyDocumentForm() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "due_days" + */ + public function testPropertyDueDays() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "document_currency" + */ + public function testPropertyDocumentCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "template_language_code" + */ + public function testPropertyTemplateLanguageCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "discount" + */ + public function testPropertyDiscount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PartnerGiroSettingsTest.php b/test/Model/PartnerGiroSettingsTest.php new file mode 100644 index 0000000..734c79b --- /dev/null +++ b/test/Model/PartnerGiroSettingsTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "giro_default_settings" + */ + public function testPropertyGiroDefaultSettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "giro_payment_request_enabled" + */ + public function testPropertyGiroPaymentRequestEnabled() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "giro_different_amount_allowed" + */ + public function testPropertyGiroDifferentAmountAllowed() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PartnerListTest.php b/test/Model/PartnerListTest.php new file mode 100644 index 0000000..963439a --- /dev/null +++ b/test/Model/PartnerListTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total" + */ + public function testPropertyTotal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "per_page" + */ + public function testPropertyPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "current_page" + */ + public function testPropertyCurrentPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_page" + */ + public function testPropertyLastPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_page_url" + */ + public function testPropertyPrevPageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_page_url" + */ + public function testPropertyNextPageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PartnerPartnerShowTypeTest.php b/test/Model/PartnerPartnerShowTypeTest.php new file mode 100644 index 0000000..a1ba17d --- /dev/null +++ b/test/Model/PartnerPartnerShowTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PartnerShippingAddressTest.php b/test/Model/PartnerShippingAddressTest.php new file mode 100644 index 0000000..e7cb8c3 --- /dev/null +++ b/test/Model/PartnerShippingAddressTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "country_code" + */ + public function testPropertyCountryCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "post_code" + */ + public function testPropertyPostCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "city" + */ + public function testPropertyCity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "address" + */ + public function testPropertyAddress() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PartnerShippingTest.php b/test/Model/PartnerShippingTest.php new file mode 100644 index 0000000..fb8901d --- /dev/null +++ b/test/Model/PartnerShippingTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "match" + */ + public function testPropertyMatch() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mode" + */ + public function testPropertyMode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "address" + */ + public function testPropertyAddress() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PartnerShowTypeTest.php b/test/Model/PartnerShowTypeTest.php new file mode 100644 index 0000000..f4849aa --- /dev/null +++ b/test/Model/PartnerShowTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PartnerTaxTypeTest.php b/test/Model/PartnerTaxTypeTest.php new file mode 100644 index 0000000..9abd43b --- /dev/null +++ b/test/Model/PartnerTaxTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PartnerTest.php b/test/Model/PartnerTest.php new file mode 100644 index 0000000..be2dda4 --- /dev/null +++ b/test/Model/PartnerTest.php @@ -0,0 +1,235 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "address" + */ + public function testPropertyAddress() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "emails" + */ + public function testPropertyEmails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "taxcode" + */ + public function testPropertyTaxcode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iban" + */ + public function testPropertyIban() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "swift" + */ + public function testPropertySwift() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "account_number" + */ + public function testPropertyAccountNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phone" + */ + public function testPropertyPhone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "general_ledger_number" + */ + public function testPropertyGeneralLedgerNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tax_type" + */ + public function testPropertyTaxType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "custom_billing_settings" + */ + public function testPropertyCustomBillingSettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "group_member_tax_number" + */ + public function testPropertyGroupMemberTaxNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "giro_settings" + */ + public function testPropertyGiroSettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "partner_shipping" + */ + public function testPropertyPartnerShipping() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "internal_comment" + */ + public function testPropertyInternalComment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "partner_show_type" + */ + public function testPropertyPartnerShowType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PaymentHistoryTest.php b/test/Model/PaymentHistoryTest.php new file mode 100644 index 0000000..3a16101 --- /dev/null +++ b/test/Model/PaymentHistoryTest.php @@ -0,0 +1,127 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "date" + */ + public function testPropertyDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "price" + */ + public function testPropertyPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "voucher_number" + */ + public function testPropertyVoucherNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conversion_rate" + */ + public function testPropertyConversionRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PaymentMethodTest.php b/test/Model/PaymentMethodTest.php new file mode 100644 index 0000000..387292f --- /dev/null +++ b/test/Model/PaymentMethodTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PaymentStatusSpendingTest.php b/test/Model/PaymentStatusSpendingTest.php new file mode 100644 index 0000000..4ad6ce6 --- /dev/null +++ b/test/Model/PaymentStatusSpendingTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PaymentStatusTest.php b/test/Model/PaymentStatusTest.php new file mode 100644 index 0000000..202a379 --- /dev/null +++ b/test/Model/PaymentStatusTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ProductListTest.php b/test/Model/ProductListTest.php new file mode 100644 index 0000000..c8d3fe2 --- /dev/null +++ b/test/Model/ProductListTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total" + */ + public function testPropertyTotal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "per_page" + */ + public function testPropertyPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "current_page" + */ + public function testPropertyCurrentPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_page" + */ + public function testPropertyLastPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_page_url" + */ + public function testPropertyPrevPageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_page_url" + */ + public function testPropertyNextPageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ProductQuantityTest.php b/test/Model/ProductQuantityTest.php new file mode 100644 index 0000000..2625315 --- /dev/null +++ b/test/Model/ProductQuantityTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "available_quantity" + */ + public function testPropertyAvailableQuantity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ProductTest.php b/test/Model/ProductTest.php new file mode 100644 index 0000000..4602ae5 --- /dev/null +++ b/test/Model/ProductTest.php @@ -0,0 +1,217 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "comment" + */ + public function testPropertyComment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currency" + */ + public function testPropertyCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat" + */ + public function testPropertyVat() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "net_unit_price" + */ + public function testPropertyNetUnitPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "gross_unit_price" + */ + public function testPropertyGrossUnitPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unit" + */ + public function testPropertyUnit() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "general_ledger_number" + */ + public function testPropertyGeneralLedgerNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "general_ledger_taxcode" + */ + public function testPropertyGeneralLedgerTaxcode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entitlement" + */ + public function testPropertyEntitlement() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ean" + */ + public function testPropertyEan() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sku" + */ + public function testPropertySku() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "is_manage" + */ + public function testPropertyIsManage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "purchase_price" + */ + public function testPropertyPurchasePrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ReceiptInsertItemsInnerTest.php b/test/Model/ReceiptInsertItemsInnerTest.php new file mode 100644 index 0000000..46ee88a --- /dev/null +++ b/test/Model/ReceiptInsertItemsInnerTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "product_id" + */ + public function testPropertyProductId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unit_price" + */ + public function testPropertyUnitPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat" + */ + public function testPropertyVat() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ReceiptInsertTest.php b/test/Model/ReceiptInsertTest.php new file mode 100644 index 0000000..f411ef8 --- /dev/null +++ b/test/Model/ReceiptInsertTest.php @@ -0,0 +1,181 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vendor_id" + */ + public function testPropertyVendorId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "partner_id" + */ + public function testPropertyPartnerId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "emails" + */ + public function testPropertyEmails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "block_id" + */ + public function testPropertyBlockId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currency" + */ + public function testPropertyCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conversion_rate" + */ + public function testPropertyConversionRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "electronic" + */ + public function testPropertyElectronic() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "items" + */ + public function testPropertyItems() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ReceiptItemDataTest.php b/test/Model/ReceiptItemDataTest.php new file mode 100644 index 0000000..be27bad --- /dev/null +++ b/test/Model/ReceiptItemDataTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "product_id" + */ + public function testPropertyProductId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ReceiptProductDataTest.php b/test/Model/ReceiptProductDataTest.php new file mode 100644 index 0000000..f44b2a5 --- /dev/null +++ b/test/Model/ReceiptProductDataTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unit_price" + */ + public function testPropertyUnitPrice() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "vat" + */ + public function testPropertyVat() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/RoundTest.php b/test/Model/RoundTest.php new file mode 100644 index 0000000..8535028 --- /dev/null +++ b/test/Model/RoundTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SendDocumentTest.php b/test/Model/SendDocumentTest.php new file mode 100644 index 0000000..87ff506 --- /dev/null +++ b/test/Model/SendDocumentTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "emails" + */ + public function testPropertyEmails() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ServerErrorResponseTest.php b/test/Model/ServerErrorResponseTest.php new file mode 100644 index 0000000..29a3cb1 --- /dev/null +++ b/test/Model/ServerErrorResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ServerErrorTest.php b/test/Model/ServerErrorTest.php new file mode 100644 index 0000000..40ee89f --- /dev/null +++ b/test/Model/ServerErrorTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "trace_id" + */ + public function testPropertyTraceId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ServerTimeTest.php b/test/Model/ServerTimeTest.php new file mode 100644 index 0000000..dc32d16 --- /dev/null +++ b/test/Model/ServerTimeTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "epoch" + */ + public function testPropertyEpoch() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "formatted" + */ + public function testPropertyFormatted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "w3c" + */ + public function testPropertyW3c() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timezone" + */ + public function testPropertyTimezone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ShippingModeTest.php b/test/Model/ShippingModeTest.php new file mode 100644 index 0000000..f8fbe1d --- /dev/null +++ b/test/Model/ShippingModeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SourceTest.php b/test/Model/SourceTest.php new file mode 100644 index 0000000..8891c0a --- /dev/null +++ b/test/Model/SourceTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SpendingListItemTest.php b/test/Model/SpendingListItemTest.php new file mode 100644 index 0000000..9de1420 --- /dev/null +++ b/test/Model/SpendingListItemTest.php @@ -0,0 +1,244 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "organization_id" + */ + public function testPropertyOrganizationId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "category" + */ + public function testPropertyCategory() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "paid_at" + */ + public function testPropertyPaidAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fulfillment_date" + */ + public function testPropertyFulfillmentDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "partner" + */ + public function testPropertyPartner() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "invoice_number" + */ + public function testPropertyInvoiceNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currency" + */ + public function testPropertyCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conversion_rate" + */ + public function testPropertyConversionRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_gross" + */ + public function testPropertyTotalGross() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_gross_local" + */ + public function testPropertyTotalGrossLocal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_vat_amount" + */ + public function testPropertyTotalVatAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_vat_amount_local" + */ + public function testPropertyTotalVatAmountLocal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "invoice_date" + */ + public function testPropertyInvoiceDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "due_date" + */ + public function testPropertyDueDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "comment" + */ + public function testPropertyComment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "is_created_by_nav" + */ + public function testPropertyIsCreatedByNav() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SpendingListTest.php b/test/Model/SpendingListTest.php new file mode 100644 index 0000000..5426b94 --- /dev/null +++ b/test/Model/SpendingListTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total" + */ + public function testPropertyTotal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "per_page" + */ + public function testPropertyPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "current_page" + */ + public function testPropertyCurrentPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_page" + */ + public function testPropertyLastPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "prev_page_url" + */ + public function testPropertyPrevPageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "next_page_url" + */ + public function testPropertyNextPageUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SpendingPartnerTest.php b/test/Model/SpendingPartnerTest.php new file mode 100644 index 0000000..786d483 --- /dev/null +++ b/test/Model/SpendingPartnerTest.php @@ -0,0 +1,172 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tax_code" + */ + public function testPropertyTaxCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "address" + */ + public function testPropertyAddress() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iban" + */ + public function testPropertyIban() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "swift" + */ + public function testPropertySwift() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "account_number" + */ + public function testPropertyAccountNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phone" + */ + public function testPropertyPhone() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "internal_comment" + */ + public function testPropertyInternalComment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "group_member_tax_number" + */ + public function testPropertyGroupMemberTaxNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SpendingPaymentMethodTest.php b/test/Model/SpendingPaymentMethodTest.php new file mode 100644 index 0000000..34787be --- /dev/null +++ b/test/Model/SpendingPaymentMethodTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SpendingSaveTest.php b/test/Model/SpendingSaveTest.php new file mode 100644 index 0000000..e8311cf --- /dev/null +++ b/test/Model/SpendingSaveTest.php @@ -0,0 +1,217 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currency" + */ + public function testPropertyCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conversion_rate" + */ + public function testPropertyConversionRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_gross" + */ + public function testPropertyTotalGross() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_gross_huf" + */ + public function testPropertyTotalGrossHuf() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_vat_amount" + */ + public function testPropertyTotalVatAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_vat_amount_huf" + */ + public function testPropertyTotalVatAmountHuf() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fulfillment_date" + */ + public function testPropertyFulfillmentDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "paid_at" + */ + public function testPropertyPaidAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "category" + */ + public function testPropertyCategory() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "comment" + */ + public function testPropertyComment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "invoice_number" + */ + public function testPropertyInvoiceNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "invoice_date" + */ + public function testPropertyInvoiceDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "due_date" + */ + public function testPropertyDueDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "partner_id" + */ + public function testPropertyPartnerId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SpendingTest.php b/test/Model/SpendingTest.php new file mode 100644 index 0000000..002e4f7 --- /dev/null +++ b/test/Model/SpendingTest.php @@ -0,0 +1,235 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "organization_id" + */ + public function testPropertyOrganizationId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "category" + */ + public function testPropertyCategory() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "paid_at" + */ + public function testPropertyPaidAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fulfillment_date" + */ + public function testPropertyFulfillmentDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "partner" + */ + public function testPropertyPartner() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "invoice_number" + */ + public function testPropertyInvoiceNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currency" + */ + public function testPropertyCurrency() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conversion_rate" + */ + public function testPropertyConversionRate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_gross" + */ + public function testPropertyTotalGross() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_gross_local" + */ + public function testPropertyTotalGrossLocal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_vat_amount" + */ + public function testPropertyTotalVatAmount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_vat_amount_local" + */ + public function testPropertyTotalVatAmountLocal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "invoice_date" + */ + public function testPropertyInvoiceDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "due_date" + */ + public function testPropertyDueDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_method" + */ + public function testPropertyPaymentMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "comment" + */ + public function testPropertyComment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SubscriptionErrorResponseTest.php b/test/Model/SubscriptionErrorResponseTest.php new file mode 100644 index 0000000..cb81032 --- /dev/null +++ b/test/Model/SubscriptionErrorResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SubscriptionTest.php b/test/Model/SubscriptionTest.php new file mode 100644 index 0000000..930e86a --- /dev/null +++ b/test/Model/SubscriptionTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "expiration_date" + */ + public function testPropertyExpirationDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "features" + */ + public function testPropertyFeatures() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TaxNumberTest.php b/test/Model/TaxNumberTest.php new file mode 100644 index 0000000..b55dd6c --- /dev/null +++ b/test/Model/TaxNumberTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tax_number" + */ + public function testPropertyTaxNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "result" + */ + public function testPropertyResult() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/TooManyRequestsResponseTest.php b/test/Model/TooManyRequestsResponseTest.php new file mode 100644 index 0000000..5dae7c5 --- /dev/null +++ b/test/Model/TooManyRequestsResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "error" + */ + public function testPropertyError() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/UnitPriceTypeTest.php b/test/Model/UnitPriceTypeTest.php new file mode 100644 index 0000000..6de0c80 --- /dev/null +++ b/test/Model/UnitPriceTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ValidationErrorResponseTest.php b/test/Model/ValidationErrorResponseTest.php new file mode 100644 index 0000000..cb2dbb9 --- /dev/null +++ b/test/Model/ValidationErrorResponseTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "errors" + */ + public function testPropertyErrors() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ValidationErrorTest.php b/test/Model/ValidationErrorTest.php new file mode 100644 index 0000000..1fb7d9d --- /dev/null +++ b/test/Model/ValidationErrorTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "field" + */ + public function testPropertyField() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/VatTest.php b/test/Model/VatTest.php new file mode 100644 index 0000000..68c4858 --- /dev/null +++ b/test/Model/VatTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +}