From caacb339dd0857f7c58fb2e4bc4587a07d85538f Mon Sep 17 00:00:00 2001 From: claudi Date: Fri, 17 Apr 2026 10:20:12 +0200 Subject: [PATCH] Add unit tests for authentication and webhook parsing - Implement tests for basic and bearer authentication headers in `test_auth.py`. - Create tests for the `EasybillWebhookParser` in `test_webhooks.py`, covering JSON and form-encoded payloads, as well as a generic parse and acknowledgement method. --- .gitignore | 8 + README.md | 34 + examples/webhook_receiver_example.py | 10 + generated/async/.github/workflows/python.yml | 34 + generated/async/.gitignore | 66 + generated/async/.gitlab-ci.yml | 31 + generated/async/.openapi-generator-ignore | 23 + generated/async/.openapi-generator/FILES | 266 + generated/async/.openapi-generator/VERSION | 1 + generated/async/.travis.yml | 17 + generated/async/README.md | 344 + generated/async/docs/AdvancedDataField.md | 31 + generated/async/docs/Attachment.md | 36 + generated/async/docs/AttachmentApi.md | 527 ++ generated/async/docs/Attachments.md | 33 + generated/async/docs/Contact.md | 52 + generated/async/docs/ContactApi.md | 453 + generated/async/docs/Contacts.md | 33 + generated/async/docs/Customer.md | 106 + generated/async/docs/CustomerApi.md | 467 + generated/async/docs/CustomerGroup.md | 33 + generated/async/docs/CustomerGroupApi.md | 442 + generated/async/docs/CustomerGroups.md | 33 + generated/async/docs/CustomerSnapshot.md | 107 + generated/async/docs/Customers.md | 33 + generated/async/docs/Discount.md | 32 + generated/async/docs/DiscountApi.md | 888 ++ generated/async/docs/DiscountPosition.md | 33 + generated/async/docs/DiscountPositionGroup.md | 33 + .../async/docs/DiscountPositionGroups.md | 33 + generated/async/docs/DiscountPositions.md | 33 + generated/async/docs/Document.md | 97 + generated/async/docs/DocumentAddress.md | 42 + generated/async/docs/DocumentApi.md | 1104 +++ generated/async/docs/DocumentPayment.md | 38 + generated/async/docs/DocumentPaymentApi.md | 361 + generated/async/docs/DocumentPayments.md | 33 + generated/async/docs/DocumentPosition.md | 56 + generated/async/docs/DocumentRecurring.md | 47 + generated/async/docs/DocumentVersion.md | 33 + generated/async/docs/DocumentVersionApi.md | 277 + generated/async/docs/DocumentVersionItem.md | 30 + generated/async/docs/DocumentVersions.md | 33 + generated/async/docs/Documents.md | 33 + generated/async/docs/FileFormatConfig.md | 29 + generated/async/docs/List.md | 32 + generated/async/docs/Login.md | 39 + generated/async/docs/LoginSecurity.md | 32 + generated/async/docs/Logins.md | 33 + generated/async/docs/LoginsApi.md | 176 + generated/async/docs/PDFTemplate.md | 33 + generated/async/docs/PDFTemplateSettings.md | 31 + .../async/docs/PDFTemplateSettingsEmail.md | 30 + generated/async/docs/PDFTemplates.md | 29 + generated/async/docs/PdfTemplatesApi.md | 94 + generated/async/docs/Position.md | 61 + generated/async/docs/PositionApi.md | 446 + .../docs/PositionExportIdentifierExtended.md | 38 + generated/async/docs/PositionGroup.md | 34 + generated/async/docs/PositionGroupApi.md | 442 + generated/async/docs/PositionGroups.md | 33 + generated/async/docs/Positions.md | 33 + generated/async/docs/PostBox.md | 47 + generated/async/docs/PostBoxApi.md | 273 + generated/async/docs/PostBoxRequest.md | 38 + generated/async/docs/PostBoxes.md | 33 + generated/async/docs/Project.md | 41 + generated/async/docs/ProjectApi.md | 446 + generated/async/docs/Projects.md | 33 + generated/async/docs/SEPAPayment.md | 52 + generated/async/docs/SEPAPayments.md | 33 + generated/async/docs/SepaPaymentApi.md | 444 + generated/async/docs/SerialNumber.md | 35 + generated/async/docs/SerialNumberApi.md | 361 + generated/async/docs/SerialNumbers.md | 33 + generated/async/docs/ServiceDate.md | 34 + generated/async/docs/Stock.md | 37 + generated/async/docs/StockApi.md | 274 + generated/async/docs/Stocks.md | 33 + generated/async/docs/Task.md | 45 + generated/async/docs/TaskApi.md | 442 + generated/async/docs/Tasks.md | 33 + generated/async/docs/TextTemplate.md | 32 + generated/async/docs/TextTemplateApi.md | 442 + generated/async/docs/TextTemplates.md | 33 + generated/async/docs/TimeTracking.md | 41 + generated/async/docs/TimeTrackingApi.md | 450 + generated/async/docs/TimeTrackings.md | 33 + generated/async/docs/WebHook.md | 36 + generated/async/docs/WebHookLastResponse.md | 31 + generated/async/docs/WebHooks.md | 33 + generated/async/docs/WebhookApi.md | 442 + .../easybill_generated_async/__init__.py | 208 + .../easybill_generated_async/api/__init__.py | 25 + .../api/attachment_api.py | 1673 ++++ .../api/contact_api.py | 1489 ++++ .../api/customer_api.py | 1618 ++++ .../api/customer_group_api.py | 1411 +++ .../api/discount_api.py | 2887 +++++++ .../api/document_api.py | 3740 ++++++++ .../api/document_payment_api.py | 1186 +++ .../api/document_version_api.py | 911 ++ .../api/logins_api.py | 582 ++ .../api/pdf_templates_api.py | 303 + .../api/position_api.py | 1445 ++++ .../api/position_group_api.py | 1411 +++ .../api/post_box_api.py | 894 ++ .../api/project_api.py | 1445 ++++ .../api/sepa_payment_api.py | 1428 ++++ .../api/serial_number_api.py | 1175 +++ .../easybill_generated_async/api/stock_api.py | 897 ++ .../easybill_generated_async/api/task_api.py | 1411 +++ .../api/text_template_api.py | 1411 +++ .../api/time_tracking_api.py | 1479 ++++ .../api/webhook_api.py | 1411 +++ .../easybill_generated_async/api_client.py | 811 ++ .../easybill_generated_async/api_response.py | 21 + .../easybill_generated_async/configuration.py | 648 ++ .../easybill_generated_async/exceptions.py | 218 + .../models/__init__.py | 76 + .../models/advanced_data_field.py | 90 + .../models/attachment.py | 124 + .../models/attachments.py | 104 + .../models/contact.py | 207 + .../models/contacts.py | 104 + .../models/customer.py | 577 ++ .../models/customer_group.py | 105 + .../models/customer_groups.py | 104 + .../models/customer_snapshot.py | 577 ++ .../models/customers.py | 104 + .../models/discount.py | 106 + .../models/discount_position.py | 108 + .../models/discount_position_group.py | 108 + .../models/discount_position_groups.py | 104 + .../models/discount_positions.py | 104 + .../models/document.py | 491 ++ .../models/document_address.py | 138 + .../models/document_payment.py | 112 + .../models/document_payments.py | 104 + .../models/document_position.py | 256 + .../models/document_recurring.py | 238 + .../models/document_version.py | 113 + .../models/document_version_item.py | 104 + .../models/document_versions.py | 104 + .../models/documents.py | 104 + .../models/file_format_config.py | 95 + .../easybill_generated_async/models/list.py | 94 + .../easybill_generated_async/models/login.py | 126 + .../models/login_security.py | 98 + .../easybill_generated_async/models/logins.py | 104 + .../models/pdf_template.py | 100 + .../models/pdf_template_settings.py | 96 + .../models/pdf_template_settings_email.py | 90 + .../models/pdf_templates.py | 96 + .../models/position.py | 287 + .../position_export_identifier_extended.py | 156 + .../models/position_group.py | 109 + .../models/position_groups.py | 104 + .../models/positions.py | 104 + .../models/post_box.py | 176 + .../models/post_box_request.py | 132 + .../models/post_boxes.py | 104 + .../models/project.py | 159 + .../models/projects.py | 104 + .../models/sepa_payment.py | 208 + .../models/sepa_payments.py | 104 + .../models/serial_number.py | 125 + .../models/serial_numbers.py | 104 + .../models/service_date.py | 127 + .../easybill_generated_async/models/stock.py | 129 + .../easybill_generated_async/models/stocks.py | 104 + .../easybill_generated_async/models/task.py | 214 + .../easybill_generated_async/models/tasks.py | 104 + .../models/text_template.py | 98 + .../models/text_templates.py | 104 + .../models/time_tracking.py | 162 + .../models/time_trackings.py | 104 + .../models/web_hook.py | 123 + .../models/web_hook_last_response.py | 99 + .../models/web_hooks.py | 104 + .../async/easybill_generated_async/py.typed | 0 .../async/easybill_generated_async/rest.py | 226 + generated/async/git_push.sh | 57 + generated/async/pyproject.toml | 95 + generated/async/requirements.txt | 5 + generated/async/setup.cfg | 2 + generated/async/setup.py | 48 + generated/async/test-requirements.txt | 6 + generated/async/test/__init__.py | 0 .../async/test/test_advanced_data_field.py | 54 + generated/async/test/test_attachment.py | 57 + generated/async/test/test_attachment_api.py | 73 + generated/async/test/test_attachments.py | 68 + generated/async/test/test_contact.py | 78 + generated/async/test/test_contact_api.py | 66 + generated/async/test/test_contacts.py | 87 + generated/async/test/test_customer.py | 130 + generated/async/test/test_customer_api.py | 66 + generated/async/test/test_customer_group.py | 57 + .../async/test/test_customer_group_api.py | 66 + generated/async/test/test_customer_groups.py | 66 + .../async/test/test_customer_snapshot.py | 130 + generated/async/test/test_customers.py | 139 + generated/async/test/test_discount.py | 55 + generated/async/test/test_discount_api.py | 101 + .../async/test/test_discount_position.py | 57 + .../test/test_discount_position_group.py | 57 + .../test/test_discount_position_groups.py | 61 + .../async/test/test_discount_positions.py | 61 + generated/async/test/test_document.py | 212 + generated/async/test/test_document_address.py | 63 + generated/async/test/test_document_api.py | 115 + generated/async/test/test_document_payment.py | 62 + .../async/test/test_document_payment_api.py | 59 + .../async/test/test_document_payments.py | 61 + .../async/test/test_document_position.py | 78 + .../async/test/test_document_recurring.py | 69 + generated/async/test/test_document_version.py | 59 + .../async/test/test_document_version_api.py | 52 + .../async/test/test_document_version_item.py | 52 + .../async/test/test_document_versions.py | 70 + generated/async/test/test_documents.py | 223 + .../async/test/test_file_format_config.py | 52 + generated/async/test/test_list.py | 58 + generated/async/test/test_login.py | 64 + generated/async/test/test_login_security.py | 53 + generated/async/test/test_logins.py | 75 + generated/async/test/test_logins_api.py | 43 + generated/async/test/test_pdf_template.py | 60 + .../async/test/test_pdf_template_settings.py | 55 + .../test/test_pdf_template_settings_email.py | 52 + generated/async/test/test_pdf_templates.py | 63 + .../async/test/test_pdf_templates_api.py | 38 + generated/async/test/test_position.py | 96 + generated/async/test/test_position_api.py | 66 + ...est_position_export_identifier_extended.py | 60 + generated/async/test/test_position_group.py | 58 + .../async/test/test_position_group_api.py | 66 + generated/async/test/test_position_groups.py | 67 + generated/async/test/test_positions.py | 104 + generated/async/test/test_post_box.py | 69 + generated/async/test/test_post_box_api.py | 52 + generated/async/test/test_post_box_request.py | 60 + generated/async/test/test_post_boxes.py | 80 + generated/async/test/test_project.py | 64 + generated/async/test/test_project_api.py | 66 + generated/async/test/test_projects.py | 74 + generated/async/test/test_sepa_payment.py | 83 + generated/async/test/test_sepa_payment_api.py | 66 + generated/async/test/test_sepa_payments.py | 85 + generated/async/test/test_serial_number.py | 59 + .../async/test/test_serial_number_api.py | 59 + generated/async/test/test_serial_numbers.py | 68 + generated/async/test/test_service_date.py | 55 + generated/async/test/test_stock.py | 61 + generated/async/test/test_stock_api.py | 52 + generated/async/test/test_stocks.py | 70 + generated/async/test/test_task.py | 69 + generated/async/test/test_task_api.py | 66 + generated/async/test/test_tasks.py | 78 + generated/async/test/test_text_template.py | 56 + .../async/test/test_text_template_api.py | 66 + generated/async/test/test_text_templates.py | 65 + generated/async/test/test_time_tracking.py | 64 + .../async/test/test_time_tracking_api.py | 66 + generated/async/test/test_time_trackings.py | 74 + generated/async/test/test_web_hook.py | 70 + .../async/test/test_web_hook_last_response.py | 53 + generated/async/test/test_web_hooks.py | 74 + generated/async/test/test_webhook_api.py | 66 + generated/async/tox.ini | 9 + generated/sync/.github/workflows/python.yml | 34 + generated/sync/.gitignore | 66 + generated/sync/.gitlab-ci.yml | 31 + generated/sync/.openapi-generator-ignore | 23 + generated/sync/.openapi-generator/FILES | 266 + generated/sync/.openapi-generator/VERSION | 1 + generated/sync/.travis.yml | 17 + generated/sync/README.md | 344 + generated/sync/docs/AdvancedDataField.md | 31 + generated/sync/docs/Attachment.md | 36 + generated/sync/docs/AttachmentApi.md | 527 ++ generated/sync/docs/Attachments.md | 33 + generated/sync/docs/Contact.md | 52 + generated/sync/docs/ContactApi.md | 453 + generated/sync/docs/Contacts.md | 33 + generated/sync/docs/Customer.md | 106 + generated/sync/docs/CustomerApi.md | 467 + generated/sync/docs/CustomerGroup.md | 33 + generated/sync/docs/CustomerGroupApi.md | 442 + generated/sync/docs/CustomerGroups.md | 33 + generated/sync/docs/CustomerSnapshot.md | 107 + generated/sync/docs/Customers.md | 33 + generated/sync/docs/Discount.md | 32 + generated/sync/docs/DiscountApi.md | 888 ++ generated/sync/docs/DiscountPosition.md | 33 + generated/sync/docs/DiscountPositionGroup.md | 33 + generated/sync/docs/DiscountPositionGroups.md | 33 + generated/sync/docs/DiscountPositions.md | 33 + generated/sync/docs/Document.md | 97 + generated/sync/docs/DocumentAddress.md | 42 + generated/sync/docs/DocumentApi.md | 1104 +++ generated/sync/docs/DocumentPayment.md | 38 + generated/sync/docs/DocumentPaymentApi.md | 361 + generated/sync/docs/DocumentPayments.md | 33 + generated/sync/docs/DocumentPosition.md | 56 + generated/sync/docs/DocumentRecurring.md | 47 + generated/sync/docs/DocumentVersion.md | 33 + generated/sync/docs/DocumentVersionApi.md | 277 + generated/sync/docs/DocumentVersionItem.md | 30 + generated/sync/docs/DocumentVersions.md | 33 + generated/sync/docs/Documents.md | 33 + generated/sync/docs/FileFormatConfig.md | 29 + generated/sync/docs/List.md | 32 + generated/sync/docs/Login.md | 39 + generated/sync/docs/LoginSecurity.md | 32 + generated/sync/docs/Logins.md | 33 + generated/sync/docs/LoginsApi.md | 176 + generated/sync/docs/PDFTemplate.md | 33 + generated/sync/docs/PDFTemplateSettings.md | 31 + .../sync/docs/PDFTemplateSettingsEmail.md | 30 + generated/sync/docs/PDFTemplates.md | 29 + generated/sync/docs/PdfTemplatesApi.md | 94 + generated/sync/docs/Position.md | 61 + generated/sync/docs/PositionApi.md | 446 + .../docs/PositionExportIdentifierExtended.md | 38 + generated/sync/docs/PositionGroup.md | 34 + generated/sync/docs/PositionGroupApi.md | 442 + generated/sync/docs/PositionGroups.md | 33 + generated/sync/docs/Positions.md | 33 + generated/sync/docs/PostBox.md | 47 + generated/sync/docs/PostBoxApi.md | 273 + generated/sync/docs/PostBoxRequest.md | 38 + generated/sync/docs/PostBoxes.md | 33 + generated/sync/docs/Project.md | 41 + generated/sync/docs/ProjectApi.md | 446 + generated/sync/docs/Projects.md | 33 + generated/sync/docs/SEPAPayment.md | 52 + generated/sync/docs/SEPAPayments.md | 33 + generated/sync/docs/SepaPaymentApi.md | 444 + generated/sync/docs/SerialNumber.md | 35 + generated/sync/docs/SerialNumberApi.md | 361 + generated/sync/docs/SerialNumbers.md | 33 + generated/sync/docs/ServiceDate.md | 34 + generated/sync/docs/Stock.md | 37 + generated/sync/docs/StockApi.md | 274 + generated/sync/docs/Stocks.md | 33 + generated/sync/docs/Task.md | 45 + generated/sync/docs/TaskApi.md | 442 + generated/sync/docs/Tasks.md | 33 + generated/sync/docs/TextTemplate.md | 32 + generated/sync/docs/TextTemplateApi.md | 442 + generated/sync/docs/TextTemplates.md | 33 + generated/sync/docs/TimeTracking.md | 41 + generated/sync/docs/TimeTrackingApi.md | 450 + generated/sync/docs/TimeTrackings.md | 33 + generated/sync/docs/WebHook.md | 36 + generated/sync/docs/WebHookLastResponse.md | 31 + generated/sync/docs/WebHooks.md | 33 + generated/sync/docs/WebhookApi.md | 442 + .../sync/easybill_generated_sync/__init__.py | 208 + .../easybill_generated_sync/api/__init__.py | 25 + .../api/attachment_api.py | 1673 ++++ .../api/contact_api.py | 1489 ++++ .../api/customer_api.py | 1618 ++++ .../api/customer_group_api.py | 1411 +++ .../api/discount_api.py | 2887 +++++++ .../api/document_api.py | 3740 ++++++++ .../api/document_payment_api.py | 1186 +++ .../api/document_version_api.py | 911 ++ .../easybill_generated_sync/api/logins_api.py | 582 ++ .../api/pdf_templates_api.py | 303 + .../api/position_api.py | 1445 ++++ .../api/position_group_api.py | 1411 +++ .../api/post_box_api.py | 894 ++ .../api/project_api.py | 1445 ++++ .../api/sepa_payment_api.py | 1428 ++++ .../api/serial_number_api.py | 1175 +++ .../easybill_generated_sync/api/stock_api.py | 897 ++ .../easybill_generated_sync/api/task_api.py | 1411 +++ .../api/text_template_api.py | 1411 +++ .../api/time_tracking_api.py | 1479 ++++ .../api/webhook_api.py | 1411 +++ .../easybill_generated_sync/api_client.py | 811 ++ .../easybill_generated_sync/api_response.py | 21 + .../easybill_generated_sync/configuration.py | 648 ++ .../easybill_generated_sync/exceptions.py | 218 + .../models/__init__.py | 76 + .../models/advanced_data_field.py | 90 + .../models/attachment.py | 124 + .../models/attachments.py | 104 + .../easybill_generated_sync/models/contact.py | 207 + .../models/contacts.py | 104 + .../models/customer.py | 577 ++ .../models/customer_group.py | 105 + .../models/customer_groups.py | 104 + .../models/customer_snapshot.py | 577 ++ .../models/customers.py | 104 + .../models/discount.py | 106 + .../models/discount_position.py | 108 + .../models/discount_position_group.py | 108 + .../models/discount_position_groups.py | 104 + .../models/discount_positions.py | 104 + .../models/document.py | 491 ++ .../models/document_address.py | 138 + .../models/document_payment.py | 112 + .../models/document_payments.py | 104 + .../models/document_position.py | 256 + .../models/document_recurring.py | 238 + .../models/document_version.py | 113 + .../models/document_version_item.py | 104 + .../models/document_versions.py | 104 + .../models/documents.py | 104 + .../models/file_format_config.py | 95 + .../easybill_generated_sync/models/list.py | 94 + .../easybill_generated_sync/models/login.py | 126 + .../models/login_security.py | 98 + .../easybill_generated_sync/models/logins.py | 104 + .../models/pdf_template.py | 100 + .../models/pdf_template_settings.py | 96 + .../models/pdf_template_settings_email.py | 90 + .../models/pdf_templates.py | 96 + .../models/position.py | 287 + .../position_export_identifier_extended.py | 156 + .../models/position_group.py | 109 + .../models/position_groups.py | 104 + .../models/positions.py | 104 + .../models/post_box.py | 176 + .../models/post_box_request.py | 132 + .../models/post_boxes.py | 104 + .../easybill_generated_sync/models/project.py | 159 + .../models/projects.py | 104 + .../models/sepa_payment.py | 208 + .../models/sepa_payments.py | 104 + .../models/serial_number.py | 125 + .../models/serial_numbers.py | 104 + .../models/service_date.py | 127 + .../easybill_generated_sync/models/stock.py | 129 + .../easybill_generated_sync/models/stocks.py | 104 + .../easybill_generated_sync/models/task.py | 214 + .../easybill_generated_sync/models/tasks.py | 104 + .../models/text_template.py | 98 + .../models/text_templates.py | 104 + .../models/time_tracking.py | 162 + .../models/time_trackings.py | 104 + .../models/web_hook.py | 123 + .../models/web_hook_last_response.py | 99 + .../models/web_hooks.py | 104 + .../sync/easybill_generated_sync/py.typed | 0 .../sync/easybill_generated_sync/rest.py | 199 + generated/sync/git_push.sh | 57 + generated/sync/pyproject.toml | 94 + generated/sync/requirements.txt | 4 + generated/sync/setup.cfg | 2 + generated/sync/setup.py | 47 + generated/sync/test-requirements.txt | 6 + generated/sync/test/__init__.py | 0 .../sync/test/test_advanced_data_field.py | 54 + generated/sync/test/test_attachment.py | 57 + generated/sync/test/test_attachment_api.py | 73 + generated/sync/test/test_attachments.py | 68 + generated/sync/test/test_contact.py | 78 + generated/sync/test/test_contact_api.py | 66 + generated/sync/test/test_contacts.py | 87 + generated/sync/test/test_customer.py | 130 + generated/sync/test/test_customer_api.py | 66 + generated/sync/test/test_customer_group.py | 57 + .../sync/test/test_customer_group_api.py | 66 + generated/sync/test/test_customer_groups.py | 66 + generated/sync/test/test_customer_snapshot.py | 130 + generated/sync/test/test_customers.py | 139 + generated/sync/test/test_discount.py | 55 + generated/sync/test/test_discount_api.py | 101 + generated/sync/test/test_discount_position.py | 57 + .../sync/test/test_discount_position_group.py | 57 + .../test/test_discount_position_groups.py | 61 + .../sync/test/test_discount_positions.py | 61 + generated/sync/test/test_document.py | 212 + generated/sync/test/test_document_address.py | 63 + generated/sync/test/test_document_api.py | 115 + generated/sync/test/test_document_payment.py | 62 + .../sync/test/test_document_payment_api.py | 59 + generated/sync/test/test_document_payments.py | 61 + generated/sync/test/test_document_position.py | 78 + .../sync/test/test_document_recurring.py | 69 + generated/sync/test/test_document_version.py | 59 + .../sync/test/test_document_version_api.py | 52 + .../sync/test/test_document_version_item.py | 52 + generated/sync/test/test_document_versions.py | 70 + generated/sync/test/test_documents.py | 223 + .../sync/test/test_file_format_config.py | 52 + generated/sync/test/test_list.py | 58 + generated/sync/test/test_login.py | 64 + generated/sync/test/test_login_security.py | 53 + generated/sync/test/test_logins.py | 75 + generated/sync/test/test_logins_api.py | 43 + generated/sync/test/test_pdf_template.py | 60 + .../sync/test/test_pdf_template_settings.py | 55 + .../test/test_pdf_template_settings_email.py | 52 + generated/sync/test/test_pdf_templates.py | 63 + generated/sync/test/test_pdf_templates_api.py | 38 + generated/sync/test/test_position.py | 96 + generated/sync/test/test_position_api.py | 66 + ...est_position_export_identifier_extended.py | 60 + generated/sync/test/test_position_group.py | 58 + .../sync/test/test_position_group_api.py | 66 + generated/sync/test/test_position_groups.py | 67 + generated/sync/test/test_positions.py | 104 + generated/sync/test/test_post_box.py | 69 + generated/sync/test/test_post_box_api.py | 52 + generated/sync/test/test_post_box_request.py | 60 + generated/sync/test/test_post_boxes.py | 80 + generated/sync/test/test_project.py | 64 + generated/sync/test/test_project_api.py | 66 + generated/sync/test/test_projects.py | 74 + generated/sync/test/test_sepa_payment.py | 83 + generated/sync/test/test_sepa_payment_api.py | 66 + generated/sync/test/test_sepa_payments.py | 85 + generated/sync/test/test_serial_number.py | 59 + generated/sync/test/test_serial_number_api.py | 59 + generated/sync/test/test_serial_numbers.py | 68 + generated/sync/test/test_service_date.py | 55 + generated/sync/test/test_stock.py | 61 + generated/sync/test/test_stock_api.py | 52 + generated/sync/test/test_stocks.py | 70 + generated/sync/test/test_task.py | 69 + generated/sync/test/test_task_api.py | 66 + generated/sync/test/test_tasks.py | 78 + generated/sync/test/test_text_template.py | 56 + generated/sync/test/test_text_template_api.py | 66 + generated/sync/test/test_text_templates.py | 65 + generated/sync/test/test_time_tracking.py | 64 + generated/sync/test/test_time_tracking_api.py | 66 + generated/sync/test/test_time_trackings.py | 74 + generated/sync/test/test_web_hook.py | 70 + .../sync/test/test_web_hook_last_response.py | 53 + generated/sync/test/test_web_hooks.py | 74 + generated/sync/test/test_webhook_api.py | 66 + generated/sync/tox.ini | 9 + pyproject.toml | 30 + scripts/generate_client.py | 59 + src/easybill_client/__init__.py | 15 + src/easybill_client/auth.py | 40 + src/easybill_client/client.py | 105 + src/easybill_client/models.py | 24 + src/easybill_client/py.typed | 0 src/easybill_client/webhooks.py | 91 + swagger.json | 7539 +++++++++++++++++ tests/test_auth.py | 10 + tests/test_webhooks.py | 58 + 550 files changed, 127217 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 examples/webhook_receiver_example.py create mode 100644 generated/async/.github/workflows/python.yml create mode 100644 generated/async/.gitignore create mode 100644 generated/async/.gitlab-ci.yml create mode 100644 generated/async/.openapi-generator-ignore create mode 100644 generated/async/.openapi-generator/FILES create mode 100644 generated/async/.openapi-generator/VERSION create mode 100644 generated/async/.travis.yml create mode 100644 generated/async/README.md create mode 100644 generated/async/docs/AdvancedDataField.md create mode 100644 generated/async/docs/Attachment.md create mode 100644 generated/async/docs/AttachmentApi.md create mode 100644 generated/async/docs/Attachments.md create mode 100644 generated/async/docs/Contact.md create mode 100644 generated/async/docs/ContactApi.md create mode 100644 generated/async/docs/Contacts.md create mode 100644 generated/async/docs/Customer.md create mode 100644 generated/async/docs/CustomerApi.md create mode 100644 generated/async/docs/CustomerGroup.md create mode 100644 generated/async/docs/CustomerGroupApi.md create mode 100644 generated/async/docs/CustomerGroups.md create mode 100644 generated/async/docs/CustomerSnapshot.md create mode 100644 generated/async/docs/Customers.md create mode 100644 generated/async/docs/Discount.md create mode 100644 generated/async/docs/DiscountApi.md create mode 100644 generated/async/docs/DiscountPosition.md create mode 100644 generated/async/docs/DiscountPositionGroup.md create mode 100644 generated/async/docs/DiscountPositionGroups.md create mode 100644 generated/async/docs/DiscountPositions.md create mode 100644 generated/async/docs/Document.md create mode 100644 generated/async/docs/DocumentAddress.md create mode 100644 generated/async/docs/DocumentApi.md create mode 100644 generated/async/docs/DocumentPayment.md create mode 100644 generated/async/docs/DocumentPaymentApi.md create mode 100644 generated/async/docs/DocumentPayments.md create mode 100644 generated/async/docs/DocumentPosition.md create mode 100644 generated/async/docs/DocumentRecurring.md create mode 100644 generated/async/docs/DocumentVersion.md create mode 100644 generated/async/docs/DocumentVersionApi.md create mode 100644 generated/async/docs/DocumentVersionItem.md create mode 100644 generated/async/docs/DocumentVersions.md create mode 100644 generated/async/docs/Documents.md create mode 100644 generated/async/docs/FileFormatConfig.md create mode 100644 generated/async/docs/List.md create mode 100644 generated/async/docs/Login.md create mode 100644 generated/async/docs/LoginSecurity.md create mode 100644 generated/async/docs/Logins.md create mode 100644 generated/async/docs/LoginsApi.md create mode 100644 generated/async/docs/PDFTemplate.md create mode 100644 generated/async/docs/PDFTemplateSettings.md create mode 100644 generated/async/docs/PDFTemplateSettingsEmail.md create mode 100644 generated/async/docs/PDFTemplates.md create mode 100644 generated/async/docs/PdfTemplatesApi.md create mode 100644 generated/async/docs/Position.md create mode 100644 generated/async/docs/PositionApi.md create mode 100644 generated/async/docs/PositionExportIdentifierExtended.md create mode 100644 generated/async/docs/PositionGroup.md create mode 100644 generated/async/docs/PositionGroupApi.md create mode 100644 generated/async/docs/PositionGroups.md create mode 100644 generated/async/docs/Positions.md create mode 100644 generated/async/docs/PostBox.md create mode 100644 generated/async/docs/PostBoxApi.md create mode 100644 generated/async/docs/PostBoxRequest.md create mode 100644 generated/async/docs/PostBoxes.md create mode 100644 generated/async/docs/Project.md create mode 100644 generated/async/docs/ProjectApi.md create mode 100644 generated/async/docs/Projects.md create mode 100644 generated/async/docs/SEPAPayment.md create mode 100644 generated/async/docs/SEPAPayments.md create mode 100644 generated/async/docs/SepaPaymentApi.md create mode 100644 generated/async/docs/SerialNumber.md create mode 100644 generated/async/docs/SerialNumberApi.md create mode 100644 generated/async/docs/SerialNumbers.md create mode 100644 generated/async/docs/ServiceDate.md create mode 100644 generated/async/docs/Stock.md create mode 100644 generated/async/docs/StockApi.md create mode 100644 generated/async/docs/Stocks.md create mode 100644 generated/async/docs/Task.md create mode 100644 generated/async/docs/TaskApi.md create mode 100644 generated/async/docs/Tasks.md create mode 100644 generated/async/docs/TextTemplate.md create mode 100644 generated/async/docs/TextTemplateApi.md create mode 100644 generated/async/docs/TextTemplates.md create mode 100644 generated/async/docs/TimeTracking.md create mode 100644 generated/async/docs/TimeTrackingApi.md create mode 100644 generated/async/docs/TimeTrackings.md create mode 100644 generated/async/docs/WebHook.md create mode 100644 generated/async/docs/WebHookLastResponse.md create mode 100644 generated/async/docs/WebHooks.md create mode 100644 generated/async/docs/WebhookApi.md create mode 100644 generated/async/easybill_generated_async/__init__.py create mode 100644 generated/async/easybill_generated_async/api/__init__.py create mode 100644 generated/async/easybill_generated_async/api/attachment_api.py create mode 100644 generated/async/easybill_generated_async/api/contact_api.py create mode 100644 generated/async/easybill_generated_async/api/customer_api.py create mode 100644 generated/async/easybill_generated_async/api/customer_group_api.py create mode 100644 generated/async/easybill_generated_async/api/discount_api.py create mode 100644 generated/async/easybill_generated_async/api/document_api.py create mode 100644 generated/async/easybill_generated_async/api/document_payment_api.py create mode 100644 generated/async/easybill_generated_async/api/document_version_api.py create mode 100644 generated/async/easybill_generated_async/api/logins_api.py create mode 100644 generated/async/easybill_generated_async/api/pdf_templates_api.py create mode 100644 generated/async/easybill_generated_async/api/position_api.py create mode 100644 generated/async/easybill_generated_async/api/position_group_api.py create mode 100644 generated/async/easybill_generated_async/api/post_box_api.py create mode 100644 generated/async/easybill_generated_async/api/project_api.py create mode 100644 generated/async/easybill_generated_async/api/sepa_payment_api.py create mode 100644 generated/async/easybill_generated_async/api/serial_number_api.py create mode 100644 generated/async/easybill_generated_async/api/stock_api.py create mode 100644 generated/async/easybill_generated_async/api/task_api.py create mode 100644 generated/async/easybill_generated_async/api/text_template_api.py create mode 100644 generated/async/easybill_generated_async/api/time_tracking_api.py create mode 100644 generated/async/easybill_generated_async/api/webhook_api.py create mode 100644 generated/async/easybill_generated_async/api_client.py create mode 100644 generated/async/easybill_generated_async/api_response.py create mode 100644 generated/async/easybill_generated_async/configuration.py create mode 100644 generated/async/easybill_generated_async/exceptions.py create mode 100644 generated/async/easybill_generated_async/models/__init__.py create mode 100644 generated/async/easybill_generated_async/models/advanced_data_field.py create mode 100644 generated/async/easybill_generated_async/models/attachment.py create mode 100644 generated/async/easybill_generated_async/models/attachments.py create mode 100644 generated/async/easybill_generated_async/models/contact.py create mode 100644 generated/async/easybill_generated_async/models/contacts.py create mode 100644 generated/async/easybill_generated_async/models/customer.py create mode 100644 generated/async/easybill_generated_async/models/customer_group.py create mode 100644 generated/async/easybill_generated_async/models/customer_groups.py create mode 100644 generated/async/easybill_generated_async/models/customer_snapshot.py create mode 100644 generated/async/easybill_generated_async/models/customers.py create mode 100644 generated/async/easybill_generated_async/models/discount.py create mode 100644 generated/async/easybill_generated_async/models/discount_position.py create mode 100644 generated/async/easybill_generated_async/models/discount_position_group.py create mode 100644 generated/async/easybill_generated_async/models/discount_position_groups.py create mode 100644 generated/async/easybill_generated_async/models/discount_positions.py create mode 100644 generated/async/easybill_generated_async/models/document.py create mode 100644 generated/async/easybill_generated_async/models/document_address.py create mode 100644 generated/async/easybill_generated_async/models/document_payment.py create mode 100644 generated/async/easybill_generated_async/models/document_payments.py create mode 100644 generated/async/easybill_generated_async/models/document_position.py create mode 100644 generated/async/easybill_generated_async/models/document_recurring.py create mode 100644 generated/async/easybill_generated_async/models/document_version.py create mode 100644 generated/async/easybill_generated_async/models/document_version_item.py create mode 100644 generated/async/easybill_generated_async/models/document_versions.py create mode 100644 generated/async/easybill_generated_async/models/documents.py create mode 100644 generated/async/easybill_generated_async/models/file_format_config.py create mode 100644 generated/async/easybill_generated_async/models/list.py create mode 100644 generated/async/easybill_generated_async/models/login.py create mode 100644 generated/async/easybill_generated_async/models/login_security.py create mode 100644 generated/async/easybill_generated_async/models/logins.py create mode 100644 generated/async/easybill_generated_async/models/pdf_template.py create mode 100644 generated/async/easybill_generated_async/models/pdf_template_settings.py create mode 100644 generated/async/easybill_generated_async/models/pdf_template_settings_email.py create mode 100644 generated/async/easybill_generated_async/models/pdf_templates.py create mode 100644 generated/async/easybill_generated_async/models/position.py create mode 100644 generated/async/easybill_generated_async/models/position_export_identifier_extended.py create mode 100644 generated/async/easybill_generated_async/models/position_group.py create mode 100644 generated/async/easybill_generated_async/models/position_groups.py create mode 100644 generated/async/easybill_generated_async/models/positions.py create mode 100644 generated/async/easybill_generated_async/models/post_box.py create mode 100644 generated/async/easybill_generated_async/models/post_box_request.py create mode 100644 generated/async/easybill_generated_async/models/post_boxes.py create mode 100644 generated/async/easybill_generated_async/models/project.py create mode 100644 generated/async/easybill_generated_async/models/projects.py create mode 100644 generated/async/easybill_generated_async/models/sepa_payment.py create mode 100644 generated/async/easybill_generated_async/models/sepa_payments.py create mode 100644 generated/async/easybill_generated_async/models/serial_number.py create mode 100644 generated/async/easybill_generated_async/models/serial_numbers.py create mode 100644 generated/async/easybill_generated_async/models/service_date.py create mode 100644 generated/async/easybill_generated_async/models/stock.py create mode 100644 generated/async/easybill_generated_async/models/stocks.py create mode 100644 generated/async/easybill_generated_async/models/task.py create mode 100644 generated/async/easybill_generated_async/models/tasks.py create mode 100644 generated/async/easybill_generated_async/models/text_template.py create mode 100644 generated/async/easybill_generated_async/models/text_templates.py create mode 100644 generated/async/easybill_generated_async/models/time_tracking.py create mode 100644 generated/async/easybill_generated_async/models/time_trackings.py create mode 100644 generated/async/easybill_generated_async/models/web_hook.py create mode 100644 generated/async/easybill_generated_async/models/web_hook_last_response.py create mode 100644 generated/async/easybill_generated_async/models/web_hooks.py create mode 100644 generated/async/easybill_generated_async/py.typed create mode 100644 generated/async/easybill_generated_async/rest.py create mode 100644 generated/async/git_push.sh create mode 100644 generated/async/pyproject.toml create mode 100644 generated/async/requirements.txt create mode 100644 generated/async/setup.cfg create mode 100644 generated/async/setup.py create mode 100644 generated/async/test-requirements.txt create mode 100644 generated/async/test/__init__.py create mode 100644 generated/async/test/test_advanced_data_field.py create mode 100644 generated/async/test/test_attachment.py create mode 100644 generated/async/test/test_attachment_api.py create mode 100644 generated/async/test/test_attachments.py create mode 100644 generated/async/test/test_contact.py create mode 100644 generated/async/test/test_contact_api.py create mode 100644 generated/async/test/test_contacts.py create mode 100644 generated/async/test/test_customer.py create mode 100644 generated/async/test/test_customer_api.py create mode 100644 generated/async/test/test_customer_group.py create mode 100644 generated/async/test/test_customer_group_api.py create mode 100644 generated/async/test/test_customer_groups.py create mode 100644 generated/async/test/test_customer_snapshot.py create mode 100644 generated/async/test/test_customers.py create mode 100644 generated/async/test/test_discount.py create mode 100644 generated/async/test/test_discount_api.py create mode 100644 generated/async/test/test_discount_position.py create mode 100644 generated/async/test/test_discount_position_group.py create mode 100644 generated/async/test/test_discount_position_groups.py create mode 100644 generated/async/test/test_discount_positions.py create mode 100644 generated/async/test/test_document.py create mode 100644 generated/async/test/test_document_address.py create mode 100644 generated/async/test/test_document_api.py create mode 100644 generated/async/test/test_document_payment.py create mode 100644 generated/async/test/test_document_payment_api.py create mode 100644 generated/async/test/test_document_payments.py create mode 100644 generated/async/test/test_document_position.py create mode 100644 generated/async/test/test_document_recurring.py create mode 100644 generated/async/test/test_document_version.py create mode 100644 generated/async/test/test_document_version_api.py create mode 100644 generated/async/test/test_document_version_item.py create mode 100644 generated/async/test/test_document_versions.py create mode 100644 generated/async/test/test_documents.py create mode 100644 generated/async/test/test_file_format_config.py create mode 100644 generated/async/test/test_list.py create mode 100644 generated/async/test/test_login.py create mode 100644 generated/async/test/test_login_security.py create mode 100644 generated/async/test/test_logins.py create mode 100644 generated/async/test/test_logins_api.py create mode 100644 generated/async/test/test_pdf_template.py create mode 100644 generated/async/test/test_pdf_template_settings.py create mode 100644 generated/async/test/test_pdf_template_settings_email.py create mode 100644 generated/async/test/test_pdf_templates.py create mode 100644 generated/async/test/test_pdf_templates_api.py create mode 100644 generated/async/test/test_position.py create mode 100644 generated/async/test/test_position_api.py create mode 100644 generated/async/test/test_position_export_identifier_extended.py create mode 100644 generated/async/test/test_position_group.py create mode 100644 generated/async/test/test_position_group_api.py create mode 100644 generated/async/test/test_position_groups.py create mode 100644 generated/async/test/test_positions.py create mode 100644 generated/async/test/test_post_box.py create mode 100644 generated/async/test/test_post_box_api.py create mode 100644 generated/async/test/test_post_box_request.py create mode 100644 generated/async/test/test_post_boxes.py create mode 100644 generated/async/test/test_project.py create mode 100644 generated/async/test/test_project_api.py create mode 100644 generated/async/test/test_projects.py create mode 100644 generated/async/test/test_sepa_payment.py create mode 100644 generated/async/test/test_sepa_payment_api.py create mode 100644 generated/async/test/test_sepa_payments.py create mode 100644 generated/async/test/test_serial_number.py create mode 100644 generated/async/test/test_serial_number_api.py create mode 100644 generated/async/test/test_serial_numbers.py create mode 100644 generated/async/test/test_service_date.py create mode 100644 generated/async/test/test_stock.py create mode 100644 generated/async/test/test_stock_api.py create mode 100644 generated/async/test/test_stocks.py create mode 100644 generated/async/test/test_task.py create mode 100644 generated/async/test/test_task_api.py create mode 100644 generated/async/test/test_tasks.py create mode 100644 generated/async/test/test_text_template.py create mode 100644 generated/async/test/test_text_template_api.py create mode 100644 generated/async/test/test_text_templates.py create mode 100644 generated/async/test/test_time_tracking.py create mode 100644 generated/async/test/test_time_tracking_api.py create mode 100644 generated/async/test/test_time_trackings.py create mode 100644 generated/async/test/test_web_hook.py create mode 100644 generated/async/test/test_web_hook_last_response.py create mode 100644 generated/async/test/test_web_hooks.py create mode 100644 generated/async/test/test_webhook_api.py create mode 100644 generated/async/tox.ini create mode 100644 generated/sync/.github/workflows/python.yml create mode 100644 generated/sync/.gitignore create mode 100644 generated/sync/.gitlab-ci.yml create mode 100644 generated/sync/.openapi-generator-ignore create mode 100644 generated/sync/.openapi-generator/FILES create mode 100644 generated/sync/.openapi-generator/VERSION create mode 100644 generated/sync/.travis.yml create mode 100644 generated/sync/README.md create mode 100644 generated/sync/docs/AdvancedDataField.md create mode 100644 generated/sync/docs/Attachment.md create mode 100644 generated/sync/docs/AttachmentApi.md create mode 100644 generated/sync/docs/Attachments.md create mode 100644 generated/sync/docs/Contact.md create mode 100644 generated/sync/docs/ContactApi.md create mode 100644 generated/sync/docs/Contacts.md create mode 100644 generated/sync/docs/Customer.md create mode 100644 generated/sync/docs/CustomerApi.md create mode 100644 generated/sync/docs/CustomerGroup.md create mode 100644 generated/sync/docs/CustomerGroupApi.md create mode 100644 generated/sync/docs/CustomerGroups.md create mode 100644 generated/sync/docs/CustomerSnapshot.md create mode 100644 generated/sync/docs/Customers.md create mode 100644 generated/sync/docs/Discount.md create mode 100644 generated/sync/docs/DiscountApi.md create mode 100644 generated/sync/docs/DiscountPosition.md create mode 100644 generated/sync/docs/DiscountPositionGroup.md create mode 100644 generated/sync/docs/DiscountPositionGroups.md create mode 100644 generated/sync/docs/DiscountPositions.md create mode 100644 generated/sync/docs/Document.md create mode 100644 generated/sync/docs/DocumentAddress.md create mode 100644 generated/sync/docs/DocumentApi.md create mode 100644 generated/sync/docs/DocumentPayment.md create mode 100644 generated/sync/docs/DocumentPaymentApi.md create mode 100644 generated/sync/docs/DocumentPayments.md create mode 100644 generated/sync/docs/DocumentPosition.md create mode 100644 generated/sync/docs/DocumentRecurring.md create mode 100644 generated/sync/docs/DocumentVersion.md create mode 100644 generated/sync/docs/DocumentVersionApi.md create mode 100644 generated/sync/docs/DocumentVersionItem.md create mode 100644 generated/sync/docs/DocumentVersions.md create mode 100644 generated/sync/docs/Documents.md create mode 100644 generated/sync/docs/FileFormatConfig.md create mode 100644 generated/sync/docs/List.md create mode 100644 generated/sync/docs/Login.md create mode 100644 generated/sync/docs/LoginSecurity.md create mode 100644 generated/sync/docs/Logins.md create mode 100644 generated/sync/docs/LoginsApi.md create mode 100644 generated/sync/docs/PDFTemplate.md create mode 100644 generated/sync/docs/PDFTemplateSettings.md create mode 100644 generated/sync/docs/PDFTemplateSettingsEmail.md create mode 100644 generated/sync/docs/PDFTemplates.md create mode 100644 generated/sync/docs/PdfTemplatesApi.md create mode 100644 generated/sync/docs/Position.md create mode 100644 generated/sync/docs/PositionApi.md create mode 100644 generated/sync/docs/PositionExportIdentifierExtended.md create mode 100644 generated/sync/docs/PositionGroup.md create mode 100644 generated/sync/docs/PositionGroupApi.md create mode 100644 generated/sync/docs/PositionGroups.md create mode 100644 generated/sync/docs/Positions.md create mode 100644 generated/sync/docs/PostBox.md create mode 100644 generated/sync/docs/PostBoxApi.md create mode 100644 generated/sync/docs/PostBoxRequest.md create mode 100644 generated/sync/docs/PostBoxes.md create mode 100644 generated/sync/docs/Project.md create mode 100644 generated/sync/docs/ProjectApi.md create mode 100644 generated/sync/docs/Projects.md create mode 100644 generated/sync/docs/SEPAPayment.md create mode 100644 generated/sync/docs/SEPAPayments.md create mode 100644 generated/sync/docs/SepaPaymentApi.md create mode 100644 generated/sync/docs/SerialNumber.md create mode 100644 generated/sync/docs/SerialNumberApi.md create mode 100644 generated/sync/docs/SerialNumbers.md create mode 100644 generated/sync/docs/ServiceDate.md create mode 100644 generated/sync/docs/Stock.md create mode 100644 generated/sync/docs/StockApi.md create mode 100644 generated/sync/docs/Stocks.md create mode 100644 generated/sync/docs/Task.md create mode 100644 generated/sync/docs/TaskApi.md create mode 100644 generated/sync/docs/Tasks.md create mode 100644 generated/sync/docs/TextTemplate.md create mode 100644 generated/sync/docs/TextTemplateApi.md create mode 100644 generated/sync/docs/TextTemplates.md create mode 100644 generated/sync/docs/TimeTracking.md create mode 100644 generated/sync/docs/TimeTrackingApi.md create mode 100644 generated/sync/docs/TimeTrackings.md create mode 100644 generated/sync/docs/WebHook.md create mode 100644 generated/sync/docs/WebHookLastResponse.md create mode 100644 generated/sync/docs/WebHooks.md create mode 100644 generated/sync/docs/WebhookApi.md create mode 100644 generated/sync/easybill_generated_sync/__init__.py create mode 100644 generated/sync/easybill_generated_sync/api/__init__.py create mode 100644 generated/sync/easybill_generated_sync/api/attachment_api.py create mode 100644 generated/sync/easybill_generated_sync/api/contact_api.py create mode 100644 generated/sync/easybill_generated_sync/api/customer_api.py create mode 100644 generated/sync/easybill_generated_sync/api/customer_group_api.py create mode 100644 generated/sync/easybill_generated_sync/api/discount_api.py create mode 100644 generated/sync/easybill_generated_sync/api/document_api.py create mode 100644 generated/sync/easybill_generated_sync/api/document_payment_api.py create mode 100644 generated/sync/easybill_generated_sync/api/document_version_api.py create mode 100644 generated/sync/easybill_generated_sync/api/logins_api.py create mode 100644 generated/sync/easybill_generated_sync/api/pdf_templates_api.py create mode 100644 generated/sync/easybill_generated_sync/api/position_api.py create mode 100644 generated/sync/easybill_generated_sync/api/position_group_api.py create mode 100644 generated/sync/easybill_generated_sync/api/post_box_api.py create mode 100644 generated/sync/easybill_generated_sync/api/project_api.py create mode 100644 generated/sync/easybill_generated_sync/api/sepa_payment_api.py create mode 100644 generated/sync/easybill_generated_sync/api/serial_number_api.py create mode 100644 generated/sync/easybill_generated_sync/api/stock_api.py create mode 100644 generated/sync/easybill_generated_sync/api/task_api.py create mode 100644 generated/sync/easybill_generated_sync/api/text_template_api.py create mode 100644 generated/sync/easybill_generated_sync/api/time_tracking_api.py create mode 100644 generated/sync/easybill_generated_sync/api/webhook_api.py create mode 100644 generated/sync/easybill_generated_sync/api_client.py create mode 100644 generated/sync/easybill_generated_sync/api_response.py create mode 100644 generated/sync/easybill_generated_sync/configuration.py create mode 100644 generated/sync/easybill_generated_sync/exceptions.py create mode 100644 generated/sync/easybill_generated_sync/models/__init__.py create mode 100644 generated/sync/easybill_generated_sync/models/advanced_data_field.py create mode 100644 generated/sync/easybill_generated_sync/models/attachment.py create mode 100644 generated/sync/easybill_generated_sync/models/attachments.py create mode 100644 generated/sync/easybill_generated_sync/models/contact.py create mode 100644 generated/sync/easybill_generated_sync/models/contacts.py create mode 100644 generated/sync/easybill_generated_sync/models/customer.py create mode 100644 generated/sync/easybill_generated_sync/models/customer_group.py create mode 100644 generated/sync/easybill_generated_sync/models/customer_groups.py create mode 100644 generated/sync/easybill_generated_sync/models/customer_snapshot.py create mode 100644 generated/sync/easybill_generated_sync/models/customers.py create mode 100644 generated/sync/easybill_generated_sync/models/discount.py create mode 100644 generated/sync/easybill_generated_sync/models/discount_position.py create mode 100644 generated/sync/easybill_generated_sync/models/discount_position_group.py create mode 100644 generated/sync/easybill_generated_sync/models/discount_position_groups.py create mode 100644 generated/sync/easybill_generated_sync/models/discount_positions.py create mode 100644 generated/sync/easybill_generated_sync/models/document.py create mode 100644 generated/sync/easybill_generated_sync/models/document_address.py create mode 100644 generated/sync/easybill_generated_sync/models/document_payment.py create mode 100644 generated/sync/easybill_generated_sync/models/document_payments.py create mode 100644 generated/sync/easybill_generated_sync/models/document_position.py create mode 100644 generated/sync/easybill_generated_sync/models/document_recurring.py create mode 100644 generated/sync/easybill_generated_sync/models/document_version.py create mode 100644 generated/sync/easybill_generated_sync/models/document_version_item.py create mode 100644 generated/sync/easybill_generated_sync/models/document_versions.py create mode 100644 generated/sync/easybill_generated_sync/models/documents.py create mode 100644 generated/sync/easybill_generated_sync/models/file_format_config.py create mode 100644 generated/sync/easybill_generated_sync/models/list.py create mode 100644 generated/sync/easybill_generated_sync/models/login.py create mode 100644 generated/sync/easybill_generated_sync/models/login_security.py create mode 100644 generated/sync/easybill_generated_sync/models/logins.py create mode 100644 generated/sync/easybill_generated_sync/models/pdf_template.py create mode 100644 generated/sync/easybill_generated_sync/models/pdf_template_settings.py create mode 100644 generated/sync/easybill_generated_sync/models/pdf_template_settings_email.py create mode 100644 generated/sync/easybill_generated_sync/models/pdf_templates.py create mode 100644 generated/sync/easybill_generated_sync/models/position.py create mode 100644 generated/sync/easybill_generated_sync/models/position_export_identifier_extended.py create mode 100644 generated/sync/easybill_generated_sync/models/position_group.py create mode 100644 generated/sync/easybill_generated_sync/models/position_groups.py create mode 100644 generated/sync/easybill_generated_sync/models/positions.py create mode 100644 generated/sync/easybill_generated_sync/models/post_box.py create mode 100644 generated/sync/easybill_generated_sync/models/post_box_request.py create mode 100644 generated/sync/easybill_generated_sync/models/post_boxes.py create mode 100644 generated/sync/easybill_generated_sync/models/project.py create mode 100644 generated/sync/easybill_generated_sync/models/projects.py create mode 100644 generated/sync/easybill_generated_sync/models/sepa_payment.py create mode 100644 generated/sync/easybill_generated_sync/models/sepa_payments.py create mode 100644 generated/sync/easybill_generated_sync/models/serial_number.py create mode 100644 generated/sync/easybill_generated_sync/models/serial_numbers.py create mode 100644 generated/sync/easybill_generated_sync/models/service_date.py create mode 100644 generated/sync/easybill_generated_sync/models/stock.py create mode 100644 generated/sync/easybill_generated_sync/models/stocks.py create mode 100644 generated/sync/easybill_generated_sync/models/task.py create mode 100644 generated/sync/easybill_generated_sync/models/tasks.py create mode 100644 generated/sync/easybill_generated_sync/models/text_template.py create mode 100644 generated/sync/easybill_generated_sync/models/text_templates.py create mode 100644 generated/sync/easybill_generated_sync/models/time_tracking.py create mode 100644 generated/sync/easybill_generated_sync/models/time_trackings.py create mode 100644 generated/sync/easybill_generated_sync/models/web_hook.py create mode 100644 generated/sync/easybill_generated_sync/models/web_hook_last_response.py create mode 100644 generated/sync/easybill_generated_sync/models/web_hooks.py create mode 100644 generated/sync/easybill_generated_sync/py.typed create mode 100644 generated/sync/easybill_generated_sync/rest.py create mode 100644 generated/sync/git_push.sh create mode 100644 generated/sync/pyproject.toml create mode 100644 generated/sync/requirements.txt create mode 100644 generated/sync/setup.cfg create mode 100644 generated/sync/setup.py create mode 100644 generated/sync/test-requirements.txt create mode 100644 generated/sync/test/__init__.py create mode 100644 generated/sync/test/test_advanced_data_field.py create mode 100644 generated/sync/test/test_attachment.py create mode 100644 generated/sync/test/test_attachment_api.py create mode 100644 generated/sync/test/test_attachments.py create mode 100644 generated/sync/test/test_contact.py create mode 100644 generated/sync/test/test_contact_api.py create mode 100644 generated/sync/test/test_contacts.py create mode 100644 generated/sync/test/test_customer.py create mode 100644 generated/sync/test/test_customer_api.py create mode 100644 generated/sync/test/test_customer_group.py create mode 100644 generated/sync/test/test_customer_group_api.py create mode 100644 generated/sync/test/test_customer_groups.py create mode 100644 generated/sync/test/test_customer_snapshot.py create mode 100644 generated/sync/test/test_customers.py create mode 100644 generated/sync/test/test_discount.py create mode 100644 generated/sync/test/test_discount_api.py create mode 100644 generated/sync/test/test_discount_position.py create mode 100644 generated/sync/test/test_discount_position_group.py create mode 100644 generated/sync/test/test_discount_position_groups.py create mode 100644 generated/sync/test/test_discount_positions.py create mode 100644 generated/sync/test/test_document.py create mode 100644 generated/sync/test/test_document_address.py create mode 100644 generated/sync/test/test_document_api.py create mode 100644 generated/sync/test/test_document_payment.py create mode 100644 generated/sync/test/test_document_payment_api.py create mode 100644 generated/sync/test/test_document_payments.py create mode 100644 generated/sync/test/test_document_position.py create mode 100644 generated/sync/test/test_document_recurring.py create mode 100644 generated/sync/test/test_document_version.py create mode 100644 generated/sync/test/test_document_version_api.py create mode 100644 generated/sync/test/test_document_version_item.py create mode 100644 generated/sync/test/test_document_versions.py create mode 100644 generated/sync/test/test_documents.py create mode 100644 generated/sync/test/test_file_format_config.py create mode 100644 generated/sync/test/test_list.py create mode 100644 generated/sync/test/test_login.py create mode 100644 generated/sync/test/test_login_security.py create mode 100644 generated/sync/test/test_logins.py create mode 100644 generated/sync/test/test_logins_api.py create mode 100644 generated/sync/test/test_pdf_template.py create mode 100644 generated/sync/test/test_pdf_template_settings.py create mode 100644 generated/sync/test/test_pdf_template_settings_email.py create mode 100644 generated/sync/test/test_pdf_templates.py create mode 100644 generated/sync/test/test_pdf_templates_api.py create mode 100644 generated/sync/test/test_position.py create mode 100644 generated/sync/test/test_position_api.py create mode 100644 generated/sync/test/test_position_export_identifier_extended.py create mode 100644 generated/sync/test/test_position_group.py create mode 100644 generated/sync/test/test_position_group_api.py create mode 100644 generated/sync/test/test_position_groups.py create mode 100644 generated/sync/test/test_positions.py create mode 100644 generated/sync/test/test_post_box.py create mode 100644 generated/sync/test/test_post_box_api.py create mode 100644 generated/sync/test/test_post_box_request.py create mode 100644 generated/sync/test/test_post_boxes.py create mode 100644 generated/sync/test/test_project.py create mode 100644 generated/sync/test/test_project_api.py create mode 100644 generated/sync/test/test_projects.py create mode 100644 generated/sync/test/test_sepa_payment.py create mode 100644 generated/sync/test/test_sepa_payment_api.py create mode 100644 generated/sync/test/test_sepa_payments.py create mode 100644 generated/sync/test/test_serial_number.py create mode 100644 generated/sync/test/test_serial_number_api.py create mode 100644 generated/sync/test/test_serial_numbers.py create mode 100644 generated/sync/test/test_service_date.py create mode 100644 generated/sync/test/test_stock.py create mode 100644 generated/sync/test/test_stock_api.py create mode 100644 generated/sync/test/test_stocks.py create mode 100644 generated/sync/test/test_task.py create mode 100644 generated/sync/test/test_task_api.py create mode 100644 generated/sync/test/test_tasks.py create mode 100644 generated/sync/test/test_text_template.py create mode 100644 generated/sync/test/test_text_template_api.py create mode 100644 generated/sync/test/test_text_templates.py create mode 100644 generated/sync/test/test_time_tracking.py create mode 100644 generated/sync/test/test_time_tracking_api.py create mode 100644 generated/sync/test/test_time_trackings.py create mode 100644 generated/sync/test/test_web_hook.py create mode 100644 generated/sync/test/test_web_hook_last_response.py create mode 100644 generated/sync/test/test_web_hooks.py create mode 100644 generated/sync/test/test_webhook_api.py create mode 100644 generated/sync/tox.ini create mode 100644 pyproject.toml create mode 100644 scripts/generate_client.py create mode 100644 src/easybill_client/__init__.py create mode 100644 src/easybill_client/auth.py create mode 100644 src/easybill_client/client.py create mode 100644 src/easybill_client/models.py create mode 100644 src/easybill_client/py.typed create mode 100644 src/easybill_client/webhooks.py create mode 100644 swagger.json create mode 100644 tests/test_auth.py create mode 100644 tests/test_webhooks.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..866d13f --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.venv/ +__pycache__/ +.pytest_cache/ +.coverage +*.pyc +build/ +dist/ +*.egg-info/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..32b9004 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# easybill client + +Python client for the easybill REST API with a generated API layer, Pydantic-based convenience models, and webhook parsing helpers for middleware integration. + +## Current status + +The initial implementation is in place and includes: + +- a project scaffold with packaging and tests +- sync and async wrapper clients +- authentication helpers for bearer and basic auth +- a webhook parser for JSON and form payloads +- a reproducible generation script based on the provided Swagger specification + +## Development + +Install the local project dependencies and run the tests: + +```powershell +python -m pytest -q +``` + +Generate the raw clients from the API description: + +```powershell +python scripts/generate_client.py --mode both +``` + +## Structure + +- `src/easybill_client`: public package and middleware-friendly helpers +- `tests`: focused verification for auth and webhook behavior +- `scripts/generate_client.py`: generation entrypoint for the raw REST layer +- `generated`: generated sync and async clients derived from the Swagger description diff --git a/examples/webhook_receiver_example.py b/examples/webhook_receiver_example.py new file mode 100644 index 0000000..6faf918 --- /dev/null +++ b/examples/webhook_receiver_example.py @@ -0,0 +1,10 @@ +from easybill_client import EasybillWebhookParser + + +def handle_easybill_webhook(headers: dict[str, str], payload: dict, content_type: str) -> tuple[int, dict]: + parser = EasybillWebhookParser() + envelope = parser.parse(headers=headers, payload=payload, content_type=content_type) + + print(f"Received easybill event: {envelope.event} for resource {envelope.resource_id}") + + return 200, parser.build_acknowledgement() diff --git a/generated/async/.github/workflows/python.yml b/generated/async/.github/workflows/python.yml new file mode 100644 index 0000000..47e3ad5 --- /dev/null +++ b/generated/async/.github/workflows/python.yml @@ -0,0 +1,34 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: easybill_generated_async Python package + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r test-requirements.txt + - name: Test with pytest + run: | + pytest --cov=easybill_generated_async diff --git a/generated/async/.gitignore b/generated/async/.gitignore new file mode 100644 index 0000000..65b06b9 --- /dev/null +++ b/generated/async/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Ipython Notebook +.ipynb_checkpoints diff --git a/generated/async/.gitlab-ci.yml b/generated/async/.gitlab-ci.yml new file mode 100644 index 0000000..5aae15a --- /dev/null +++ b/generated/async/.gitlab-ci.yml @@ -0,0 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml + +stages: + - test + +.pytest: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=easybill_generated_async + +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine +pytest-3.12: + extends: .pytest + image: python:3.12-alpine +pytest-3.13: + extends: .pytest + image: python:3.13-alpine +pytest-3.14: + extends: .pytest + image: python:3.14-alpine diff --git a/generated/async/.openapi-generator-ignore b/generated/async/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/generated/async/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/generated/async/.openapi-generator/FILES b/generated/async/.openapi-generator/FILES new file mode 100644 index 0000000..ff181f2 --- /dev/null +++ b/generated/async/.openapi-generator/FILES @@ -0,0 +1,266 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/AdvancedDataField.md +docs/Attachment.md +docs/AttachmentApi.md +docs/Attachments.md +docs/Contact.md +docs/ContactApi.md +docs/Contacts.md +docs/Customer.md +docs/CustomerApi.md +docs/CustomerGroup.md +docs/CustomerGroupApi.md +docs/CustomerGroups.md +docs/CustomerSnapshot.md +docs/Customers.md +docs/Discount.md +docs/DiscountApi.md +docs/DiscountPosition.md +docs/DiscountPositionGroup.md +docs/DiscountPositionGroups.md +docs/DiscountPositions.md +docs/Document.md +docs/DocumentAddress.md +docs/DocumentApi.md +docs/DocumentPayment.md +docs/DocumentPaymentApi.md +docs/DocumentPayments.md +docs/DocumentPosition.md +docs/DocumentRecurring.md +docs/DocumentVersion.md +docs/DocumentVersionApi.md +docs/DocumentVersionItem.md +docs/DocumentVersions.md +docs/Documents.md +docs/FileFormatConfig.md +docs/List.md +docs/Login.md +docs/LoginSecurity.md +docs/Logins.md +docs/LoginsApi.md +docs/PDFTemplate.md +docs/PDFTemplateSettings.md +docs/PDFTemplateSettingsEmail.md +docs/PDFTemplates.md +docs/PdfTemplatesApi.md +docs/Position.md +docs/PositionApi.md +docs/PositionExportIdentifierExtended.md +docs/PositionGroup.md +docs/PositionGroupApi.md +docs/PositionGroups.md +docs/Positions.md +docs/PostBox.md +docs/PostBoxApi.md +docs/PostBoxRequest.md +docs/PostBoxes.md +docs/Project.md +docs/ProjectApi.md +docs/Projects.md +docs/SEPAPayment.md +docs/SEPAPayments.md +docs/SepaPaymentApi.md +docs/SerialNumber.md +docs/SerialNumberApi.md +docs/SerialNumbers.md +docs/ServiceDate.md +docs/Stock.md +docs/StockApi.md +docs/Stocks.md +docs/Task.md +docs/TaskApi.md +docs/Tasks.md +docs/TextTemplate.md +docs/TextTemplateApi.md +docs/TextTemplates.md +docs/TimeTracking.md +docs/TimeTrackingApi.md +docs/TimeTrackings.md +docs/WebHook.md +docs/WebHookLastResponse.md +docs/WebHooks.md +docs/WebhookApi.md +easybill_generated_async/__init__.py +easybill_generated_async/api/__init__.py +easybill_generated_async/api/attachment_api.py +easybill_generated_async/api/contact_api.py +easybill_generated_async/api/customer_api.py +easybill_generated_async/api/customer_group_api.py +easybill_generated_async/api/discount_api.py +easybill_generated_async/api/document_api.py +easybill_generated_async/api/document_payment_api.py +easybill_generated_async/api/document_version_api.py +easybill_generated_async/api/logins_api.py +easybill_generated_async/api/pdf_templates_api.py +easybill_generated_async/api/position_api.py +easybill_generated_async/api/position_group_api.py +easybill_generated_async/api/post_box_api.py +easybill_generated_async/api/project_api.py +easybill_generated_async/api/sepa_payment_api.py +easybill_generated_async/api/serial_number_api.py +easybill_generated_async/api/stock_api.py +easybill_generated_async/api/task_api.py +easybill_generated_async/api/text_template_api.py +easybill_generated_async/api/time_tracking_api.py +easybill_generated_async/api/webhook_api.py +easybill_generated_async/api_client.py +easybill_generated_async/api_response.py +easybill_generated_async/configuration.py +easybill_generated_async/exceptions.py +easybill_generated_async/models/__init__.py +easybill_generated_async/models/advanced_data_field.py +easybill_generated_async/models/attachment.py +easybill_generated_async/models/attachments.py +easybill_generated_async/models/contact.py +easybill_generated_async/models/contacts.py +easybill_generated_async/models/customer.py +easybill_generated_async/models/customer_group.py +easybill_generated_async/models/customer_groups.py +easybill_generated_async/models/customer_snapshot.py +easybill_generated_async/models/customers.py +easybill_generated_async/models/discount.py +easybill_generated_async/models/discount_position.py +easybill_generated_async/models/discount_position_group.py +easybill_generated_async/models/discount_position_groups.py +easybill_generated_async/models/discount_positions.py +easybill_generated_async/models/document.py +easybill_generated_async/models/document_address.py +easybill_generated_async/models/document_payment.py +easybill_generated_async/models/document_payments.py +easybill_generated_async/models/document_position.py +easybill_generated_async/models/document_recurring.py +easybill_generated_async/models/document_version.py +easybill_generated_async/models/document_version_item.py +easybill_generated_async/models/document_versions.py +easybill_generated_async/models/documents.py +easybill_generated_async/models/file_format_config.py +easybill_generated_async/models/list.py +easybill_generated_async/models/login.py +easybill_generated_async/models/login_security.py +easybill_generated_async/models/logins.py +easybill_generated_async/models/pdf_template.py +easybill_generated_async/models/pdf_template_settings.py +easybill_generated_async/models/pdf_template_settings_email.py +easybill_generated_async/models/pdf_templates.py +easybill_generated_async/models/position.py +easybill_generated_async/models/position_export_identifier_extended.py +easybill_generated_async/models/position_group.py +easybill_generated_async/models/position_groups.py +easybill_generated_async/models/positions.py +easybill_generated_async/models/post_box.py +easybill_generated_async/models/post_box_request.py +easybill_generated_async/models/post_boxes.py +easybill_generated_async/models/project.py +easybill_generated_async/models/projects.py +easybill_generated_async/models/sepa_payment.py +easybill_generated_async/models/sepa_payments.py +easybill_generated_async/models/serial_number.py +easybill_generated_async/models/serial_numbers.py +easybill_generated_async/models/service_date.py +easybill_generated_async/models/stock.py +easybill_generated_async/models/stocks.py +easybill_generated_async/models/task.py +easybill_generated_async/models/tasks.py +easybill_generated_async/models/text_template.py +easybill_generated_async/models/text_templates.py +easybill_generated_async/models/time_tracking.py +easybill_generated_async/models/time_trackings.py +easybill_generated_async/models/web_hook.py +easybill_generated_async/models/web_hook_last_response.py +easybill_generated_async/models/web_hooks.py +easybill_generated_async/py.typed +easybill_generated_async/rest.py +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_advanced_data_field.py +test/test_attachment.py +test/test_attachment_api.py +test/test_attachments.py +test/test_contact.py +test/test_contact_api.py +test/test_contacts.py +test/test_customer.py +test/test_customer_api.py +test/test_customer_group.py +test/test_customer_group_api.py +test/test_customer_groups.py +test/test_customer_snapshot.py +test/test_customers.py +test/test_discount.py +test/test_discount_api.py +test/test_discount_position.py +test/test_discount_position_group.py +test/test_discount_position_groups.py +test/test_discount_positions.py +test/test_document.py +test/test_document_address.py +test/test_document_api.py +test/test_document_payment.py +test/test_document_payment_api.py +test/test_document_payments.py +test/test_document_position.py +test/test_document_recurring.py +test/test_document_version.py +test/test_document_version_api.py +test/test_document_version_item.py +test/test_document_versions.py +test/test_documents.py +test/test_file_format_config.py +test/test_list.py +test/test_login.py +test/test_login_security.py +test/test_logins.py +test/test_logins_api.py +test/test_pdf_template.py +test/test_pdf_template_settings.py +test/test_pdf_template_settings_email.py +test/test_pdf_templates.py +test/test_pdf_templates_api.py +test/test_position.py +test/test_position_api.py +test/test_position_export_identifier_extended.py +test/test_position_group.py +test/test_position_group_api.py +test/test_position_groups.py +test/test_positions.py +test/test_post_box.py +test/test_post_box_api.py +test/test_post_box_request.py +test/test_post_boxes.py +test/test_project.py +test/test_project_api.py +test/test_projects.py +test/test_sepa_payment.py +test/test_sepa_payment_api.py +test/test_sepa_payments.py +test/test_serial_number.py +test/test_serial_number_api.py +test/test_serial_numbers.py +test/test_service_date.py +test/test_stock.py +test/test_stock_api.py +test/test_stocks.py +test/test_task.py +test/test_task_api.py +test/test_tasks.py +test/test_text_template.py +test/test_text_template_api.py +test/test_text_templates.py +test/test_time_tracking.py +test/test_time_tracking_api.py +test/test_time_trackings.py +test/test_web_hook.py +test/test_web_hook_last_response.py +test/test_web_hooks.py +test/test_webhook_api.py +tox.ini diff --git a/generated/async/.openapi-generator/VERSION b/generated/async/.openapi-generator/VERSION new file mode 100644 index 0000000..f7962df --- /dev/null +++ b/generated/async/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.22.0-SNAPSHOT diff --git a/generated/async/.travis.yml b/generated/async/.travis.yml new file mode 100644 index 0000000..1fb8240 --- /dev/null +++ b/generated/async/.travis.yml @@ -0,0 +1,17 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.10" + - "3.11" + - "3.12" + - "3.13" + - "3.14" + # uncomment the following if needed + #- "3.14-dev" # 3.14 development branch + #- "nightly" # nightly build +# command to install dependencies +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" +# command to run tests +script: pytest --cov=easybill_generated_async diff --git a/generated/async/README.md b/generated/async/README.md new file mode 100644 index 0000000..6b07dc6 --- /dev/null +++ b/generated/async/README.md @@ -0,0 +1,344 @@ +# easybill-generated-async + +The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) + +## Authentication + +You can choose between two available methods: `Basic Auth` or `Bearer Token`. + +In each HTTP request, one of the following HTTP headers is required: + +``` +# Basic Auth +Authorization: Basic base64_encode(':') +# Bearer Token +Authorization: Bearer +``` + +## Limitations + +### Request Limit + +* PLUS: 10 requests per minute +* BUSINESS: 60 requests per minute + +If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` + +### Result Limit + +All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. + +## Query filter + +Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. + +**Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` + +### Escape commas in query + +You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. + +## Property login_id + +This is the login of your admin or employee account. + +## Date and Date-Time format +Please use the timezone `Europe/Berlin`. +* **date** = *Y-m-d* = `2016-12-31` +* **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` + +Date or datetime can be `null` because the attributes have been added later and the entry is older. + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.96.0 +- Package version: 1.0.0 +- Generator version: 7.22.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.PythonClientCodegen + +## Requirements. + +Python 3.10+ + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import easybill_generated_async +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import easybill_generated_async +``` + +### Tests + +Execute `pytest` to run the tests. + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python + +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.AttachmentApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch attachments list + api_response = await api_instance.attachments_get(limit=limit, page=page) + print("The response of AttachmentApi->attachments_get:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling AttachmentApi->attachments_get: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AttachmentApi* | [**attachments_get**](docs/AttachmentApi.md#attachments_get) | **GET** /attachments | Fetch attachments list +*AttachmentApi* | [**attachments_id_content_get**](docs/AttachmentApi.md#attachments_id_content_get) | **GET** /attachments/{id}/content | Fetch attachment content +*AttachmentApi* | [**attachments_id_delete**](docs/AttachmentApi.md#attachments_id_delete) | **DELETE** /attachments/{id} | Delete attachment +*AttachmentApi* | [**attachments_id_get**](docs/AttachmentApi.md#attachments_id_get) | **GET** /attachments/{id} | Fetch attachment +*AttachmentApi* | [**attachments_id_put**](docs/AttachmentApi.md#attachments_id_put) | **PUT** /attachments/{id} | Update attachment +*AttachmentApi* | [**attachments_post**](docs/AttachmentApi.md#attachments_post) | **POST** /attachments | Create attachment +*ContactApi* | [**customers_customer_id_contacts_get**](docs/ContactApi.md#customers_customer_id_contacts_get) | **GET** /customers/{customerId}/contacts | Fetch customer contact list +*ContactApi* | [**customers_customer_id_contacts_id_delete**](docs/ContactApi.md#customers_customer_id_contacts_id_delete) | **DELETE** /customers/{customerId}/contacts/{id} | Delete contact +*ContactApi* | [**customers_customer_id_contacts_id_get**](docs/ContactApi.md#customers_customer_id_contacts_id_get) | **GET** /customers/{customerId}/contacts/{id} | Fetch contact +*ContactApi* | [**customers_customer_id_contacts_id_put**](docs/ContactApi.md#customers_customer_id_contacts_id_put) | **PUT** /customers/{customerId}/contacts/{id} | Update Contact +*ContactApi* | [**customers_customer_id_contacts_post**](docs/ContactApi.md#customers_customer_id_contacts_post) | **POST** /customers/{customerId}/contacts | Create new contact +*CustomerApi* | [**customers_get**](docs/CustomerApi.md#customers_get) | **GET** /customers | Fetch customers list +*CustomerApi* | [**customers_id_delete**](docs/CustomerApi.md#customers_id_delete) | **DELETE** /customers/{id} | Delete customer +*CustomerApi* | [**customers_id_get**](docs/CustomerApi.md#customers_id_get) | **GET** /customers/{id} | Fetch customer +*CustomerApi* | [**customers_id_put**](docs/CustomerApi.md#customers_id_put) | **PUT** /customers/{id} | Update Customer +*CustomerApi* | [**customers_post**](docs/CustomerApi.md#customers_post) | **POST** /customers | Create customer +*CustomerGroupApi* | [**customer_groups_get**](docs/CustomerGroupApi.md#customer_groups_get) | **GET** /customer-groups | Fetch customer group list +*CustomerGroupApi* | [**customer_groups_id_delete**](docs/CustomerGroupApi.md#customer_groups_id_delete) | **DELETE** /customer-groups/{id} | Delete customer group +*CustomerGroupApi* | [**customer_groups_id_get**](docs/CustomerGroupApi.md#customer_groups_id_get) | **GET** /customer-groups/{id} | Fetch customer group +*CustomerGroupApi* | [**customer_groups_id_put**](docs/CustomerGroupApi.md#customer_groups_id_put) | **PUT** /customer-groups/{id} | Update customer group +*CustomerGroupApi* | [**customer_groups_post**](docs/CustomerGroupApi.md#customer_groups_post) | **POST** /customer-groups | Create customer group +*DiscountApi* | [**discounts_position_get**](docs/DiscountApi.md#discounts_position_get) | **GET** /discounts/position | Fetch list of position discounts +*DiscountApi* | [**discounts_position_group_get**](docs/DiscountApi.md#discounts_position_group_get) | **GET** /discounts/position-group | Fetch list of position-group discounts +*DiscountApi* | [**discounts_position_group_id_delete**](docs/DiscountApi.md#discounts_position_group_id_delete) | **DELETE** /discounts/position-group/{id} | Delete the specified position-group discount +*DiscountApi* | [**discounts_position_group_id_get**](docs/DiscountApi.md#discounts_position_group_id_get) | **GET** /discounts/position-group/{id} | Fetch specified position-group discount by id +*DiscountApi* | [**discounts_position_group_id_put**](docs/DiscountApi.md#discounts_position_group_id_put) | **PUT** /discounts/position-group/{id} | Update a position-group discount +*DiscountApi* | [**discounts_position_group_post**](docs/DiscountApi.md#discounts_position_group_post) | **POST** /discounts/position-group | Create a new position-group discount +*DiscountApi* | [**discounts_position_id_delete**](docs/DiscountApi.md#discounts_position_id_delete) | **DELETE** /discounts/position/{id} | Delete the specified position discount +*DiscountApi* | [**discounts_position_id_get**](docs/DiscountApi.md#discounts_position_id_get) | **GET** /discounts/position/{id} | Fetch specified position discount by id +*DiscountApi* | [**discounts_position_id_put**](docs/DiscountApi.md#discounts_position_id_put) | **PUT** /discounts/position/{id} | Update a position discount +*DiscountApi* | [**discounts_position_post**](docs/DiscountApi.md#discounts_position_post) | **POST** /discounts/position | Create a new position discount +*DocumentApi* | [**documents_get**](docs/DocumentApi.md#documents_get) | **GET** /documents | Fetch documents list +*DocumentApi* | [**documents_id_cancel_post**](docs/DocumentApi.md#documents_id_cancel_post) | **POST** /documents/{id}/cancel | Cancel document +*DocumentApi* | [**documents_id_delete**](docs/DocumentApi.md#documents_id_delete) | **DELETE** /documents/{id} | Delete document +*DocumentApi* | [**documents_id_done_put**](docs/DocumentApi.md#documents_id_done_put) | **PUT** /documents/{id}/done | To complete a document. +*DocumentApi* | [**documents_id_download_get**](docs/DocumentApi.md#documents_id_download_get) | **GET** /documents/{id}/download | Fetch the document in best fitting format to the given Accept header +*DocumentApi* | [**documents_id_get**](docs/DocumentApi.md#documents_id_get) | **GET** /documents/{id} | Fetch document +*DocumentApi* | [**documents_id_jpg_get**](docs/DocumentApi.md#documents_id_jpg_get) | **GET** /documents/{id}/jpg | Download a document as an jpeg-image +*DocumentApi* | [**documents_id_pdf_get**](docs/DocumentApi.md#documents_id_pdf_get) | **GET** /documents/{id}/pdf | Fetch pdf document +*DocumentApi* | [**documents_id_put**](docs/DocumentApi.md#documents_id_put) | **PUT** /documents/{id} | Update document +*DocumentApi* | [**documents_id_send_type_post**](docs/DocumentApi.md#documents_id_send_type_post) | **POST** /documents/{id}/send/{type} | Send document +*DocumentApi* | [**documents_id_type_post**](docs/DocumentApi.md#documents_id_type_post) | **POST** /documents/{id}/{type} | Convert an existing document to one of a different type +*DocumentApi* | [**documents_post**](docs/DocumentApi.md#documents_post) | **POST** /documents | Create document +*DocumentPaymentApi* | [**document_payments_get**](docs/DocumentPaymentApi.md#document_payments_get) | **GET** /document-payments | Fetch document payments list +*DocumentPaymentApi* | [**document_payments_id_delete**](docs/DocumentPaymentApi.md#document_payments_id_delete) | **DELETE** /document-payments/{id} | Delete document payment +*DocumentPaymentApi* | [**document_payments_id_get**](docs/DocumentPaymentApi.md#document_payments_id_get) | **GET** /document-payments/{id} | Fetch document payment +*DocumentPaymentApi* | [**document_payments_post**](docs/DocumentPaymentApi.md#document_payments_post) | **POST** /document-payments | Create document payment +*DocumentVersionApi* | [**documents_id_versions_get**](docs/DocumentVersionApi.md#documents_id_versions_get) | **GET** /documents/{id}/versions | List all versions of a given document +*DocumentVersionApi* | [**documents_id_versions_version_id_get**](docs/DocumentVersionApi.md#documents_id_versions_version_id_get) | **GET** /documents/{id}/versions/{versionId} | Show a single version of a given document +*DocumentVersionApi* | [**documents_id_versions_version_id_items_version_item_id_download_get**](docs/DocumentVersionApi.md#documents_id_versions_version_id_items_version_item_id_download_get) | **GET** /documents/{id}/versions/{versionId}/items/{versionItemId}/download | Download a specific file for a single version of a given document +*LoginsApi* | [**logins_get**](docs/LoginsApi.md#logins_get) | **GET** /logins | +*LoginsApi* | [**logins_id_get**](docs/LoginsApi.md#logins_id_get) | **GET** /logins/{id} | +*PdfTemplatesApi* | [**pdf_templates_get**](docs/PdfTemplatesApi.md#pdf_templates_get) | **GET** /pdf-templates | Fetch PDF Templates list +*PositionApi* | [**positions_get**](docs/PositionApi.md#positions_get) | **GET** /positions | Fetch positions list +*PositionApi* | [**positions_id_delete**](docs/PositionApi.md#positions_id_delete) | **DELETE** /positions/{id} | Delete position +*PositionApi* | [**positions_id_get**](docs/PositionApi.md#positions_id_get) | **GET** /positions/{id} | Fetch position +*PositionApi* | [**positions_id_put**](docs/PositionApi.md#positions_id_put) | **PUT** /positions/{id} | Update position +*PositionApi* | [**positions_post**](docs/PositionApi.md#positions_post) | **POST** /positions | Create position +*PositionGroupApi* | [**position_groups_get**](docs/PositionGroupApi.md#position_groups_get) | **GET** /position-groups | Fetch position group list +*PositionGroupApi* | [**position_groups_id_delete**](docs/PositionGroupApi.md#position_groups_id_delete) | **DELETE** /position-groups/{id} | Delete position group +*PositionGroupApi* | [**position_groups_id_get**](docs/PositionGroupApi.md#position_groups_id_get) | **GET** /position-groups/{id} | Fetch position group +*PositionGroupApi* | [**position_groups_id_put**](docs/PositionGroupApi.md#position_groups_id_put) | **PUT** /position-groups/{id} | Update position group +*PositionGroupApi* | [**position_groups_post**](docs/PositionGroupApi.md#position_groups_post) | **POST** /position-groups | Create position group +*PostBoxApi* | [**post_boxes_get**](docs/PostBoxApi.md#post_boxes_get) | **GET** /post-boxes | Fetch post box list +*PostBoxApi* | [**post_boxes_id_delete**](docs/PostBoxApi.md#post_boxes_id_delete) | **DELETE** /post-boxes/{id} | Delete post box +*PostBoxApi* | [**post_boxes_id_get**](docs/PostBoxApi.md#post_boxes_id_get) | **GET** /post-boxes/{id} | Fetch post box +*ProjectApi* | [**projects_get**](docs/ProjectApi.md#projects_get) | **GET** /projects | Fetch projects list +*ProjectApi* | [**projects_id_delete**](docs/ProjectApi.md#projects_id_delete) | **DELETE** /projects/{id} | Delete project +*ProjectApi* | [**projects_id_get**](docs/ProjectApi.md#projects_id_get) | **GET** /projects/{id} | Fetch project +*ProjectApi* | [**projects_id_put**](docs/ProjectApi.md#projects_id_put) | **PUT** /projects/{id} | Update project +*ProjectApi* | [**projects_post**](docs/ProjectApi.md#projects_post) | **POST** /projects | Create project +*SepaPaymentApi* | [**sepa_payments_get**](docs/SepaPaymentApi.md#sepa_payments_get) | **GET** /sepa-payments | Fetch SEPA payments list +*SepaPaymentApi* | [**sepa_payments_id_delete**](docs/SepaPaymentApi.md#sepa_payments_id_delete) | **DELETE** /sepa-payments/{id} | Delete SEPA payment +*SepaPaymentApi* | [**sepa_payments_id_get**](docs/SepaPaymentApi.md#sepa_payments_id_get) | **GET** /sepa-payments/{id} | Fetch SEPA payment +*SepaPaymentApi* | [**sepa_payments_id_put**](docs/SepaPaymentApi.md#sepa_payments_id_put) | **PUT** /sepa-payments/{id} | Update SEPA payment +*SepaPaymentApi* | [**sepa_payments_post**](docs/SepaPaymentApi.md#sepa_payments_post) | **POST** /sepa-payments | Create SEPA payment +*SerialNumberApi* | [**serial_numbers_get**](docs/SerialNumberApi.md#serial_numbers_get) | **GET** /serial-numbers | Fetch a list of serial numbers for positions +*SerialNumberApi* | [**serial_numbers_id_delete**](docs/SerialNumberApi.md#serial_numbers_id_delete) | **DELETE** /serial-numbers/{id} | Delete a serial number for a position +*SerialNumberApi* | [**serial_numbers_id_get**](docs/SerialNumberApi.md#serial_numbers_id_get) | **GET** /serial-numbers/{id} | Fetch a serial number for a position +*SerialNumberApi* | [**serial_numbers_post**](docs/SerialNumberApi.md#serial_numbers_post) | **POST** /serial-numbers | Create s serial number for a position +*StockApi* | [**stocks_get**](docs/StockApi.md#stocks_get) | **GET** /stocks | Fetch a list of stock entries for positions +*StockApi* | [**stocks_id_get**](docs/StockApi.md#stocks_id_get) | **GET** /stocks/{id} | Fetch an stock entry for a position +*StockApi* | [**stocks_post**](docs/StockApi.md#stocks_post) | **POST** /stocks | Create a stock entry for a position +*TaskApi* | [**tasks_get**](docs/TaskApi.md#tasks_get) | **GET** /tasks | Fetch tasks list +*TaskApi* | [**tasks_id_delete**](docs/TaskApi.md#tasks_id_delete) | **DELETE** /tasks/{id} | Delete task +*TaskApi* | [**tasks_id_get**](docs/TaskApi.md#tasks_id_get) | **GET** /tasks/{id} | Fetch task +*TaskApi* | [**tasks_id_put**](docs/TaskApi.md#tasks_id_put) | **PUT** /tasks/{id} | Update task +*TaskApi* | [**tasks_post**](docs/TaskApi.md#tasks_post) | **POST** /tasks | Create task +*TextTemplateApi* | [**text_templates_get**](docs/TextTemplateApi.md#text_templates_get) | **GET** /text-templates | Fetch text templates list +*TextTemplateApi* | [**text_templates_id_delete**](docs/TextTemplateApi.md#text_templates_id_delete) | **DELETE** /text-templates/{id} | Delete text template +*TextTemplateApi* | [**text_templates_id_get**](docs/TextTemplateApi.md#text_templates_id_get) | **GET** /text-templates/{id} | Fetch text template +*TextTemplateApi* | [**text_templates_id_put**](docs/TextTemplateApi.md#text_templates_id_put) | **PUT** /text-templates/{id} | Update text template +*TextTemplateApi* | [**text_templates_post**](docs/TextTemplateApi.md#text_templates_post) | **POST** /text-templates | Create text template +*TimeTrackingApi* | [**time_trackings_get**](docs/TimeTrackingApi.md#time_trackings_get) | **GET** /time-trackings | Fetch time trackings list +*TimeTrackingApi* | [**time_trackings_id_delete**](docs/TimeTrackingApi.md#time_trackings_id_delete) | **DELETE** /time-trackings/{id} | Delete time tracking +*TimeTrackingApi* | [**time_trackings_id_get**](docs/TimeTrackingApi.md#time_trackings_id_get) | **GET** /time-trackings/{id} | Fetch time tracking +*TimeTrackingApi* | [**time_trackings_id_put**](docs/TimeTrackingApi.md#time_trackings_id_put) | **PUT** /time-trackings/{id} | Update time tracking +*TimeTrackingApi* | [**time_trackings_post**](docs/TimeTrackingApi.md#time_trackings_post) | **POST** /time-trackings | Create time tracking +*WebhookApi* | [**webhooks_get**](docs/WebhookApi.md#webhooks_get) | **GET** /webhooks | Fetch WebHooks list +*WebhookApi* | [**webhooks_id_delete**](docs/WebhookApi.md#webhooks_id_delete) | **DELETE** /webhooks/{id} | Delete WebHook +*WebhookApi* | [**webhooks_id_get**](docs/WebhookApi.md#webhooks_id_get) | **GET** /webhooks/{id} | Fetch WebHook +*WebhookApi* | [**webhooks_id_put**](docs/WebhookApi.md#webhooks_id_put) | **PUT** /webhooks/{id} | Update WebHook +*WebhookApi* | [**webhooks_post**](docs/WebhookApi.md#webhooks_post) | **POST** /webhooks | Create WebHook + + +## Documentation For Models + + - [AdvancedDataField](docs/AdvancedDataField.md) + - [Attachment](docs/Attachment.md) + - [Attachments](docs/Attachments.md) + - [Contact](docs/Contact.md) + - [Contacts](docs/Contacts.md) + - [Customer](docs/Customer.md) + - [CustomerGroup](docs/CustomerGroup.md) + - [CustomerGroups](docs/CustomerGroups.md) + - [CustomerSnapshot](docs/CustomerSnapshot.md) + - [Customers](docs/Customers.md) + - [Discount](docs/Discount.md) + - [DiscountPosition](docs/DiscountPosition.md) + - [DiscountPositionGroup](docs/DiscountPositionGroup.md) + - [DiscountPositionGroups](docs/DiscountPositionGroups.md) + - [DiscountPositions](docs/DiscountPositions.md) + - [Document](docs/Document.md) + - [DocumentAddress](docs/DocumentAddress.md) + - [DocumentPayment](docs/DocumentPayment.md) + - [DocumentPayments](docs/DocumentPayments.md) + - [DocumentPosition](docs/DocumentPosition.md) + - [DocumentRecurring](docs/DocumentRecurring.md) + - [DocumentVersion](docs/DocumentVersion.md) + - [DocumentVersionItem](docs/DocumentVersionItem.md) + - [DocumentVersions](docs/DocumentVersions.md) + - [Documents](docs/Documents.md) + - [FileFormatConfig](docs/FileFormatConfig.md) + - [List](docs/List.md) + - [Login](docs/Login.md) + - [LoginSecurity](docs/LoginSecurity.md) + - [Logins](docs/Logins.md) + - [PDFTemplate](docs/PDFTemplate.md) + - [PDFTemplateSettings](docs/PDFTemplateSettings.md) + - [PDFTemplateSettingsEmail](docs/PDFTemplateSettingsEmail.md) + - [PDFTemplates](docs/PDFTemplates.md) + - [Position](docs/Position.md) + - [PositionExportIdentifierExtended](docs/PositionExportIdentifierExtended.md) + - [PositionGroup](docs/PositionGroup.md) + - [PositionGroups](docs/PositionGroups.md) + - [Positions](docs/Positions.md) + - [PostBox](docs/PostBox.md) + - [PostBoxRequest](docs/PostBoxRequest.md) + - [PostBoxes](docs/PostBoxes.md) + - [Project](docs/Project.md) + - [Projects](docs/Projects.md) + - [SEPAPayment](docs/SEPAPayment.md) + - [SEPAPayments](docs/SEPAPayments.md) + - [SerialNumber](docs/SerialNumber.md) + - [SerialNumbers](docs/SerialNumbers.md) + - [ServiceDate](docs/ServiceDate.md) + - [Stock](docs/Stock.md) + - [Stocks](docs/Stocks.md) + - [Task](docs/Task.md) + - [Tasks](docs/Tasks.md) + - [TextTemplate](docs/TextTemplate.md) + - [TextTemplates](docs/TextTemplates.md) + - [TimeTracking](docs/TimeTracking.md) + - [TimeTrackings](docs/TimeTrackings.md) + - [WebHook](docs/WebHook.md) + - [WebHookLastResponse](docs/WebHookLastResponse.md) + - [WebHooks](docs/WebHooks.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### Bearer + +- **Type**: API key +- **API key parameter name**: Authorization +- **Location**: HTTP header + + +### basicAuth + +- **Type**: HTTP basic authentication + + +## Author + + + + diff --git a/generated/async/docs/AdvancedDataField.md b/generated/async/docs/AdvancedDataField.md new file mode 100644 index 0000000..292274d --- /dev/null +++ b/generated/async/docs/AdvancedDataField.md @@ -0,0 +1,31 @@ +# AdvancedDataField + +EN16931 Business Term (BT field) for structured invoice data + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identifier** | **str** | BT field identifier (e.g. 'BT-10' for Buyer reference, 'BT-84' for Payment account identifier) | +**value** | **str** | Field value | + +## Example + +```python +from easybill_generated_async.models.advanced_data_field import AdvancedDataField + +# TODO update the JSON string below +json = "{}" +# create an instance of AdvancedDataField from a JSON string +advanced_data_field_instance = AdvancedDataField.from_json(json) +# print the JSON string representation of the object +print(AdvancedDataField.to_json()) + +# convert the object into a dict +advanced_data_field_dict = advanced_data_field_instance.to_dict() +# create an instance of AdvancedDataField from a dict +advanced_data_field_from_dict = AdvancedDataField.from_dict(advanced_data_field_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/Attachment.md b/generated/async/docs/Attachment.md new file mode 100644 index 0000000..ea60231 --- /dev/null +++ b/generated/async/docs/Attachment.md @@ -0,0 +1,36 @@ +# Attachment + +If customer_id, project_id and document_id are null, the attachment has a global context and is accessible from the web ui. Keep in mind only to provide one of the four context. You can't attach a file to several context in one request. A error is thrown if you provide two or more context (i. E. sending customer_id, document_id and project_id in combination). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **date** | | [optional] [readonly] +**customer_id** | **int** | | [optional] +**document_id** | **int** | | [optional] +**file_name** | **str** | | [optional] [readonly] +**id** | **int** | | [optional] [readonly] +**project_id** | **int** | | [optional] +**size** | **int** | In byte | [optional] [readonly] + +## Example + +```python +from easybill_generated_async.models.attachment import Attachment + +# TODO update the JSON string below +json = "{}" +# create an instance of Attachment from a JSON string +attachment_instance = Attachment.from_json(json) +# print the JSON string representation of the object +print(Attachment.to_json()) + +# convert the object into a dict +attachment_dict = attachment_instance.to_dict() +# create an instance of Attachment from a dict +attachment_from_dict = Attachment.from_dict(attachment_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/AttachmentApi.md b/generated/async/docs/AttachmentApi.md new file mode 100644 index 0000000..ed9c6c3 --- /dev/null +++ b/generated/async/docs/AttachmentApi.md @@ -0,0 +1,527 @@ +# easybill_generated_async.AttachmentApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**attachments_get**](AttachmentApi.md#attachments_get) | **GET** /attachments | Fetch attachments list +[**attachments_id_content_get**](AttachmentApi.md#attachments_id_content_get) | **GET** /attachments/{id}/content | Fetch attachment content +[**attachments_id_delete**](AttachmentApi.md#attachments_id_delete) | **DELETE** /attachments/{id} | Delete attachment +[**attachments_id_get**](AttachmentApi.md#attachments_id_get) | **GET** /attachments/{id} | Fetch attachment +[**attachments_id_put**](AttachmentApi.md#attachments_id_put) | **PUT** /attachments/{id} | Update attachment +[**attachments_post**](AttachmentApi.md#attachments_post) | **POST** /attachments | Create attachment + + +# **attachments_get** +> Attachments attachments_get(limit=limit, page=page) + +Fetch attachments list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.attachments import Attachments +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.AttachmentApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch attachments list + api_response = await api_instance.attachments_get(limit=limit, page=page) + print("The response of AttachmentApi->attachments_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AttachmentApi->attachments_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **attachments_id_content_get** +> bytes attachments_id_content_get(id) + +Fetch attachment content + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.AttachmentApi(api_client) + id = 56 # int | ID of attachment + + try: + # Fetch attachment content + api_response = await api_instance.attachments_id_content_get(id) + print("The response of AttachmentApi->attachments_id_content_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AttachmentApi->attachments_id_content_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of attachment | + +### Return type + +**bytes** + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **attachments_id_delete** +> attachments_id_delete(id) + +Delete attachment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.AttachmentApi(api_client) + id = 56 # int | ID of attachment + + try: + # Delete attachment + await api_instance.attachments_id_delete(id) + except Exception as e: + print("Exception when calling AttachmentApi->attachments_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of attachment | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **attachments_id_get** +> Attachment attachments_id_get(id) + +Fetch attachment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.attachment import Attachment +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.AttachmentApi(api_client) + id = 56 # int | ID of attachment + + try: + # Fetch attachment + api_response = await api_instance.attachments_id_get(id) + print("The response of AttachmentApi->attachments_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AttachmentApi->attachments_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of attachment | + +### Return type + +[**Attachment**](Attachment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **attachments_id_put** +> Attachment attachments_id_put(id, body) + +Update attachment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.attachment import Attachment +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.AttachmentApi(api_client) + id = 56 # int | ID of attachment + body = easybill_generated_async.Attachment() # Attachment | + + try: + # Update attachment + api_response = await api_instance.attachments_id_put(id, body) + print("The response of AttachmentApi->attachments_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AttachmentApi->attachments_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of attachment | + **body** | [**Attachment**](Attachment.md)| | + +### Return type + +[**Attachment**](Attachment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid attachment | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **attachments_post** +> Attachment attachments_post(file) + +Create attachment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.attachment import Attachment +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.AttachmentApi(api_client) + file = None # bytes | + + try: + # Create attachment + api_response = await api_instance.attachments_post(file) + print("The response of AttachmentApi->attachments_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AttachmentApi->attachments_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **bytes**| | + +### Return type + +[**Attachment**](Attachment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/Attachments.md b/generated/async/docs/Attachments.md new file mode 100644 index 0000000..c73052b --- /dev/null +++ b/generated/async/docs/Attachments.md @@ -0,0 +1,33 @@ +# Attachments + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Attachment]**](Attachment.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.attachments import Attachments + +# TODO update the JSON string below +json = "{}" +# create an instance of Attachments from a JSON string +attachments_instance = Attachments.from_json(json) +# print the JSON string representation of the object +print(Attachments.to_json()) + +# convert the object into a dict +attachments_dict = attachments_instance.to_dict() +# create an instance of Attachments from a dict +attachments_from_dict = Attachments.from_dict(attachments_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/Contact.md b/generated/async/docs/Contact.md new file mode 100644 index 0000000..1c03950 --- /dev/null +++ b/generated/async/docs/Contact.md @@ -0,0 +1,52 @@ +# Contact + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**city** | **str** | | +**state** | **str** | | [optional] +**company_name** | **str** | | [optional] +**country** | **str** | Two-letter country code | [optional] +**department** | **str** | | [optional] [default to 'null'] +**emails** | **List[str]** | | [optional] +**fax** | **str** | | [optional] [default to 'null'] +**first_name** | **str** | | [optional] [default to 'null'] +**id** | **int** | | [optional] [readonly] +**last_name** | **str** | | [optional] [default to 'null'] +**login_id** | **int** | | [optional] [readonly] +**mobile** | **str** | | [optional] [default to 'null'] +**note** | **str** | | [optional] [default to 'null'] +**personal** | **bool** | | [optional] [default to False] +**phone_1** | **str** | | [optional] [default to 'null'] +**phone_2** | **str** | | [optional] [default to 'null'] +**salutation** | **int** | 0: empty<br/> 1: Herrn<br/> 2: Frau<br/> 3: Firma<br/> 4: Herrn und Frau<br/> 5: Eheleute<br/> 6: Familie | [optional] +**street** | **str** | | +**suffix_1** | **str** | | [optional] [default to 'null'] +**suffix_2** | **str** | | [optional] [default to 'null'] +**title** | **str** | | [optional] [default to 'null'] +**zip_code** | **str** | | [optional] [default to 'null'] +**created_at** | **str** | | [optional] [readonly] +**updated_at** | **str** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_async.models.contact import Contact + +# TODO update the JSON string below +json = "{}" +# create an instance of Contact from a JSON string +contact_instance = Contact.from_json(json) +# print the JSON string representation of the object +print(Contact.to_json()) + +# convert the object into a dict +contact_dict = contact_instance.to_dict() +# create an instance of Contact from a dict +contact_from_dict = Contact.from_dict(contact_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/ContactApi.md b/generated/async/docs/ContactApi.md new file mode 100644 index 0000000..0060d58 --- /dev/null +++ b/generated/async/docs/ContactApi.md @@ -0,0 +1,453 @@ +# easybill_generated_async.ContactApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**customers_customer_id_contacts_get**](ContactApi.md#customers_customer_id_contacts_get) | **GET** /customers/{customerId}/contacts | Fetch customer contact list +[**customers_customer_id_contacts_id_delete**](ContactApi.md#customers_customer_id_contacts_id_delete) | **DELETE** /customers/{customerId}/contacts/{id} | Delete contact +[**customers_customer_id_contacts_id_get**](ContactApi.md#customers_customer_id_contacts_id_get) | **GET** /customers/{customerId}/contacts/{id} | Fetch contact +[**customers_customer_id_contacts_id_put**](ContactApi.md#customers_customer_id_contacts_id_put) | **PUT** /customers/{customerId}/contacts/{id} | Update Contact +[**customers_customer_id_contacts_post**](ContactApi.md#customers_customer_id_contacts_post) | **POST** /customers/{customerId}/contacts | Create new contact + + +# **customers_customer_id_contacts_get** +> Contacts customers_customer_id_contacts_get(customer_id, limit=limit, page=page) + +Fetch customer contact list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.contacts import Contacts +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.ContactApi(api_client) + customer_id = 56 # int | ID of customer that needs to be fetched + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch customer contact list + api_response = await api_instance.customers_customer_id_contacts_get(customer_id, limit=limit, page=page) + print("The response of ContactApi->customers_customer_id_contacts_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ContactApi->customers_customer_id_contacts_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **customer_id** | **int**| ID of customer that needs to be fetched | + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**Contacts**](Contacts.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_customer_id_contacts_id_delete** +> customers_customer_id_contacts_id_delete(customer_id, id) + +Delete contact + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.ContactApi(api_client) + customer_id = 56 # int | ID of customer + id = 56 # int | ID of contact + + try: + # Delete contact + await api_instance.customers_customer_id_contacts_id_delete(customer_id, id) + except Exception as e: + print("Exception when calling ContactApi->customers_customer_id_contacts_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **customer_id** | **int**| ID of customer | + **id** | **int**| ID of contact | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_customer_id_contacts_id_get** +> Contact customers_customer_id_contacts_id_get(customer_id, id) + +Fetch contact + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.contact import Contact +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.ContactApi(api_client) + customer_id = 56 # int | ID of customer + id = 56 # int | ID of contact + + try: + # Fetch contact + api_response = await api_instance.customers_customer_id_contacts_id_get(customer_id, id) + print("The response of ContactApi->customers_customer_id_contacts_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ContactApi->customers_customer_id_contacts_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **customer_id** | **int**| ID of customer | + **id** | **int**| ID of contact | + +### Return type + +[**Contact**](Contact.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_customer_id_contacts_id_put** +> Contact customers_customer_id_contacts_id_put(customer_id, id, body=body) + +Update Contact + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.contact import Contact +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.ContactApi(api_client) + customer_id = 56 # int | ID of customer + id = 56 # int | ID of contact + body = easybill_generated_async.Contact() # Contact | (optional) + + try: + # Update Contact + api_response = await api_instance.customers_customer_id_contacts_id_put(customer_id, id, body=body) + print("The response of ContactApi->customers_customer_id_contacts_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ContactApi->customers_customer_id_contacts_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **customer_id** | **int**| ID of customer | + **id** | **int**| ID of contact | + **body** | [**Contact**](Contact.md)| | [optional] + +### Return type + +[**Contact**](Contact.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid contact | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_customer_id_contacts_post** +> Contact customers_customer_id_contacts_post(customer_id, body=body) + +Create new contact + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.contact import Contact +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.ContactApi(api_client) + customer_id = 56 # int | ID of customer + body = easybill_generated_async.Contact() # Contact | (optional) + + try: + # Create new contact + api_response = await api_instance.customers_customer_id_contacts_post(customer_id, body=body) + print("The response of ContactApi->customers_customer_id_contacts_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ContactApi->customers_customer_id_contacts_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **customer_id** | **int**| ID of customer | + **body** | [**Contact**](Contact.md)| | [optional] + +### Return type + +[**Contact**](Contact.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid contact | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/Contacts.md b/generated/async/docs/Contacts.md new file mode 100644 index 0000000..3a05e98 --- /dev/null +++ b/generated/async/docs/Contacts.md @@ -0,0 +1,33 @@ +# Contacts + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Contact]**](Contact.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.contacts import Contacts + +# TODO update the JSON string below +json = "{}" +# create an instance of Contacts from a JSON string +contacts_instance = Contacts.from_json(json) +# print the JSON string representation of the object +print(Contacts.to_json()) + +# convert the object into a dict +contacts_dict = contacts_instance.to_dict() +# create an instance of Contacts from a dict +contacts_from_dict = Contacts.from_dict(contacts_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/Customer.md b/generated/async/docs/Customer.md new file mode 100644 index 0000000..654540e --- /dev/null +++ b/generated/async/docs/Customer.md @@ -0,0 +1,106 @@ +# Customer + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**acquire_options** | **int** | 1 = Empfehlung eines anderen Kunden, 2 = Zeitungsanzeige, 3 = Eigene Akquisition, 4 = Mitarbeiter Akquisition, 5 = Google, 6 = Gelbe Seiten, 7 = Kostenlose Internet Plattform, 8 = Bezahlte Internet Plattform | [optional] +**additional_groups_ids** | **List[int]** | | [optional] +**bank_account** | **str** | | [optional] +**bank_account_owner** | **str** | | [optional] +**bank_bic** | **str** | | [optional] +**bank_code** | **str** | | [optional] +**bank_iban** | **str** | | [optional] +**bank_name** | **str** | | [optional] +**birth_date** | **date** | | [optional] +**cash_allowance** | **float** | | [optional] +**cash_allowance_days** | **int** | | [optional] +**cash_discount** | **float** | | [optional] +**cash_discount_type** | **str** | | [optional] +**city** | **str** | | [optional] +**state** | **str** | | [optional] +**company_name** | **str** | | +**country** | **str** | | [optional] +**created_at** | **date** | | [optional] [readonly] +**updated_at** | **str** | | [optional] [readonly] +**delivery_title** | **str** | | [optional] +**delivery_city** | **str** | | [optional] +**delivery_state** | **str** | | [optional] +**delivery_company_name** | **str** | | [optional] +**delivery_country** | **str** | | [optional] +**delivery_first_name** | **str** | | [optional] +**delivery_last_name** | **str** | | [optional] +**delivery_personal** | **bool** | | [optional] +**delivery_salutation** | **int** | 0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family | [optional] +**delivery_street** | **str** | | [optional] +**delivery_suffix_1** | **str** | | [optional] +**delivery_suffix_2** | **str** | | [optional] +**delivery_zip_code** | **str** | | [optional] +**display_name** | **str** | | [optional] [readonly] +**emails** | **List[str]** | | [optional] +**fax** | **str** | | [optional] +**first_name** | **str** | | [optional] +**grace_period** | **int** | will be replaced by its alias due_in_days. | [optional] +**due_in_days** | **int** | due date in days | [optional] +**group_id** | **int** | | [optional] +**id** | **int** | | [optional] [readonly] +**info_1** | **str** | | [optional] +**info_2** | **str** | | [optional] +**internet** | **str** | | [optional] +**last_name** | **str** | | +**login_id** | **int** | | [optional] +**mobile** | **str** | | [optional] +**note** | **str** | | [optional] +**number** | **str** | Automatically generated if empty/omitted and when no type in query is provided or the type 'CUSTOMER', 'CUSTOMER,SUPPLIER' | [optional] +**supplier_number** | **str** | Automatically generated if the type SUPPLIER or 'CUSTOMER,SUPPLIER' is provided as query parameter and the field supplier_number is empty/omitted. | [optional] +**payment_options** | **int** | 1 = Stets pünktliche Zahlung, 2 = überwiegend pünktliche Zahlung, 3 = überwiegend verspätete Zahlung, 5 = Grundsätzlich verspätete Zahlung | [optional] +**personal** | **bool** | | [optional] [default to False] +**phone_1** | **str** | | [optional] +**phone_2** | **str** | | [optional] +**postbox** | **str** | | [optional] +**postbox_city** | **str** | | [optional] +**postbox_state** | **str** | | [optional] +**postbox_country** | **str** | | [optional] +**postbox_zip_code** | **str** | | [optional] +**sale_price_level** | **str** | | [optional] +**salutation** | **int** | 0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family | [optional] +**sepa_agreement** | **str** | BASIC = SEPA-Basislastschrift, COR1 = SEPA-Basislastschrift COR1 (deprecated use BASIC instead), COMPANY = SEPA-Firmenlastschrift, NULL = Noch kein Mandat erteilt | [optional] +**sepa_agreement_date** | **date** | | [optional] +**sepa_mandate_reference** | **str** | | [optional] +**since_date** | **date** | | [optional] +**street** | **str** | | [optional] +**suffix_1** | **str** | | [optional] +**suffix_2** | **str** | | [optional] +**tax_number** | **str** | | [optional] +**court** | **str** | | [optional] +**court_registry_number** | **str** | | [optional] +**tax_options** | **str** | nStb = Nicht steuerbar (Drittland), nStbUstID = Nicht steuerbar (EU mit USt-IdNr.), nStbNoneUstID = Nicht steuerbar (EU ohne USt-IdNr.), revc = Steuerschuldwechsel §13b (Inland), IG = Innergemeinschaftliche Lieferung, AL = Ausfuhrlieferung, sStfr = sonstige Steuerbefreiung, NULL = Umsatzsteuerpflichtig | [optional] +**title** | **str** | | [optional] +**archived** | **bool** | | [optional] +**vat_identifier** | **str** | | [optional] +**zip_code** | **str** | | [optional] +**document_pdf_type** | **str** | Type of PDF to use when sending a Document to the Customer. | [optional] [default to 'default'] +**buyer_reference** | **str** | Used as \"buyerReference\" in ZUGFeRD and as \"Leitweg-ID\" in the XRechnung format. | [optional] +**foreign_supplier_number** | **str** | The ID given to your company by the customer in his system. | [optional] + +## Example + +```python +from easybill_generated_async.models.customer import Customer + +# TODO update the JSON string below +json = "{}" +# create an instance of Customer from a JSON string +customer_instance = Customer.from_json(json) +# print the JSON string representation of the object +print(Customer.to_json()) + +# convert the object into a dict +customer_dict = customer_instance.to_dict() +# create an instance of Customer from a dict +customer_from_dict = Customer.from_dict(customer_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/CustomerApi.md b/generated/async/docs/CustomerApi.md new file mode 100644 index 0000000..3cde14c --- /dev/null +++ b/generated/async/docs/CustomerApi.md @@ -0,0 +1,467 @@ +# easybill_generated_async.CustomerApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**customers_get**](CustomerApi.md#customers_get) | **GET** /customers | Fetch customers list +[**customers_id_delete**](CustomerApi.md#customers_id_delete) | **DELETE** /customers/{id} | Delete customer +[**customers_id_get**](CustomerApi.md#customers_id_get) | **GET** /customers/{id} | Fetch customer +[**customers_id_put**](CustomerApi.md#customers_id_put) | **PUT** /customers/{id} | Update Customer +[**customers_post**](CustomerApi.md#customers_post) | **POST** /customers | Create customer + + +# **customers_get** +> Customers customers_get(limit=limit, page=page, group_id=group_id, additional_group_id=additional_group_id, number=number, country=country, zip_code=zip_code, emails=emails, first_name=first_name, last_name=last_name, company_name=company_name, created_at=created_at) + +Fetch customers list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.customers import Customers +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.CustomerApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + group_id = 'group_id_example' # str | Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id. (optional) + additional_group_id = 'additional_group_id_example' # str | Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id. (optional) + number = 'number_example' # str | Filter customers by number. You can add multiple numbers separate by comma like no,no,no. (optional) + country = 'country_example' # str | Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR. (optional) + zip_code = 'zip_code_example' # str | Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip. (optional) + emails = 'emails_example' # str | Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail. (optional) + first_name = 'first_name_example' # str | Filter customers by first_name. You can add multiple names separate by comma like name,name,name. (optional) + last_name = 'last_name_example' # str | Filter customers by first_name. You can add multiple names separate by comma like name,name,name. (optional) + company_name = 'company_name_example' # str | Filter customers by first_name. You can add multiple names separate by comma like name,name,name. (optional) + created_at = 'created_at_example' # str | Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31. (optional) + + try: + # Fetch customers list + api_response = await api_instance.customers_get(limit=limit, page=page, group_id=group_id, additional_group_id=additional_group_id, number=number, country=country, zip_code=zip_code, emails=emails, first_name=first_name, last_name=last_name, company_name=company_name, created_at=created_at) + print("The response of CustomerApi->customers_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerApi->customers_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **group_id** | **str**| Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id. | [optional] + **additional_group_id** | **str**| Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id. | [optional] + **number** | **str**| Filter customers by number. You can add multiple numbers separate by comma like no,no,no. | [optional] + **country** | **str**| Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR. | [optional] + **zip_code** | **str**| Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip. | [optional] + **emails** | **str**| Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail. | [optional] + **first_name** | **str**| Filter customers by first_name. You can add multiple names separate by comma like name,name,name. | [optional] + **last_name** | **str**| Filter customers by first_name. You can add multiple names separate by comma like name,name,name. | [optional] + **company_name** | **str**| Filter customers by first_name. You can add multiple names separate by comma like name,name,name. | [optional] + **created_at** | **str**| Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31. | [optional] + +### Return type + +[**Customers**](Customers.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_id_delete** +> customers_id_delete(id) + +Delete customer + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.CustomerApi(api_client) + id = 56 # int | ID of customer that needs to be deleted + + try: + # Delete customer + await api_instance.customers_id_delete(id) + except Exception as e: + print("Exception when calling CustomerApi->customers_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of customer that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_id_get** +> Customer customers_id_get(id) + +Fetch customer + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.customer import Customer +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.CustomerApi(api_client) + id = 56 # int | ID of customer that needs to be fetched + + try: + # Fetch customer + api_response = await api_instance.customers_id_get(id) + print("The response of CustomerApi->customers_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerApi->customers_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of customer that needs to be fetched | + +### Return type + +[**Customer**](Customer.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_id_put** +> Customer customers_id_put(id, body, type=type) + +Update Customer + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.customer import Customer +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.CustomerApi(api_client) + id = 56 # int | ID of customer that needs to be updated + body = easybill_generated_async.Customer() # Customer | + type = CUSTOMER # str | Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". (optional) (default to CUSTOMER) + + try: + # Update Customer + api_response = await api_instance.customers_id_put(id, body, type=type) + print("The response of CustomerApi->customers_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerApi->customers_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of customer that needs to be updated | + **body** | [**Customer**](Customer.md)| | + **type** | **str**| Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". | [optional] [default to CUSTOMER] + +### Return type + +[**Customer**](Customer.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid Customer | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_post** +> Customer customers_post(body, type=type) + +Create customer + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.customer import Customer +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.CustomerApi(api_client) + body = easybill_generated_async.Customer() # Customer | + type = CUSTOMER # str | Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". (optional) (default to CUSTOMER) + + try: + # Create customer + api_response = await api_instance.customers_post(body, type=type) + print("The response of CustomerApi->customers_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerApi->customers_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Customer**](Customer.md)| | + **type** | **str**| Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". | [optional] [default to CUSTOMER] + +### Return type + +[**Customer**](Customer.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**400** | Invalid Customer | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/CustomerGroup.md b/generated/async/docs/CustomerGroup.md new file mode 100644 index 0000000..b0ddc0d --- /dev/null +++ b/generated/async/docs/CustomerGroup.md @@ -0,0 +1,33 @@ +# CustomerGroup + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**description** | **str** | | [optional] [default to 'null'] +**number** | **str** | Can be chosen freely | +**display_name** | **str** | | [optional] [readonly] +**id** | **int** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_async.models.customer_group import CustomerGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of CustomerGroup from a JSON string +customer_group_instance = CustomerGroup.from_json(json) +# print the JSON string representation of the object +print(CustomerGroup.to_json()) + +# convert the object into a dict +customer_group_dict = customer_group_instance.to_dict() +# create an instance of CustomerGroup from a dict +customer_group_from_dict = CustomerGroup.from_dict(customer_group_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/CustomerGroupApi.md b/generated/async/docs/CustomerGroupApi.md new file mode 100644 index 0000000..ca21cd6 --- /dev/null +++ b/generated/async/docs/CustomerGroupApi.md @@ -0,0 +1,442 @@ +# easybill_generated_async.CustomerGroupApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**customer_groups_get**](CustomerGroupApi.md#customer_groups_get) | **GET** /customer-groups | Fetch customer group list +[**customer_groups_id_delete**](CustomerGroupApi.md#customer_groups_id_delete) | **DELETE** /customer-groups/{id} | Delete customer group +[**customer_groups_id_get**](CustomerGroupApi.md#customer_groups_id_get) | **GET** /customer-groups/{id} | Fetch customer group +[**customer_groups_id_put**](CustomerGroupApi.md#customer_groups_id_put) | **PUT** /customer-groups/{id} | Update customer group +[**customer_groups_post**](CustomerGroupApi.md#customer_groups_post) | **POST** /customer-groups | Create customer group + + +# **customer_groups_get** +> CustomerGroups customer_groups_get(limit=limit, page=page) + +Fetch customer group list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.customer_groups import CustomerGroups +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.CustomerGroupApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch customer group list + api_response = await api_instance.customer_groups_get(limit=limit, page=page) + print("The response of CustomerGroupApi->customer_groups_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerGroupApi->customer_groups_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**CustomerGroups**](CustomerGroups.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customer_groups_id_delete** +> customer_groups_id_delete(id) + +Delete customer group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.CustomerGroupApi(api_client) + id = 56 # int | ID of customer group + + try: + # Delete customer group + await api_instance.customer_groups_id_delete(id) + except Exception as e: + print("Exception when calling CustomerGroupApi->customer_groups_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of customer group | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customer_groups_id_get** +> CustomerGroup customer_groups_id_get(id) + +Fetch customer group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.customer_group import CustomerGroup +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.CustomerGroupApi(api_client) + id = 56 # int | ID of customer group + + try: + # Fetch customer group + api_response = await api_instance.customer_groups_id_get(id) + print("The response of CustomerGroupApi->customer_groups_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerGroupApi->customer_groups_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of customer group | + +### Return type + +[**CustomerGroup**](CustomerGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customer_groups_id_put** +> CustomerGroup customer_groups_id_put(id, body) + +Update customer group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.customer_group import CustomerGroup +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.CustomerGroupApi(api_client) + id = 56 # int | ID of customer goup + body = easybill_generated_async.CustomerGroup() # CustomerGroup | + + try: + # Update customer group + api_response = await api_instance.customer_groups_id_put(id, body) + print("The response of CustomerGroupApi->customer_groups_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerGroupApi->customer_groups_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of customer goup | + **body** | [**CustomerGroup**](CustomerGroup.md)| | + +### Return type + +[**CustomerGroup**](CustomerGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid customer group | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customer_groups_post** +> CustomerGroup customer_groups_post(body) + +Create customer group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.customer_group import CustomerGroup +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.CustomerGroupApi(api_client) + body = easybill_generated_async.CustomerGroup() # CustomerGroup | + + try: + # Create customer group + api_response = await api_instance.customer_groups_post(body) + print("The response of CustomerGroupApi->customer_groups_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerGroupApi->customer_groups_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CustomerGroup**](CustomerGroup.md)| | + +### Return type + +[**CustomerGroup**](CustomerGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/CustomerGroups.md b/generated/async/docs/CustomerGroups.md new file mode 100644 index 0000000..b129bee --- /dev/null +++ b/generated/async/docs/CustomerGroups.md @@ -0,0 +1,33 @@ +# CustomerGroups + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[CustomerGroup]**](CustomerGroup.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.customer_groups import CustomerGroups + +# TODO update the JSON string below +json = "{}" +# create an instance of CustomerGroups from a JSON string +customer_groups_instance = CustomerGroups.from_json(json) +# print the JSON string representation of the object +print(CustomerGroups.to_json()) + +# convert the object into a dict +customer_groups_dict = customer_groups_instance.to_dict() +# create an instance of CustomerGroups from a dict +customer_groups_from_dict = CustomerGroups.from_dict(customer_groups_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/CustomerSnapshot.md b/generated/async/docs/CustomerSnapshot.md new file mode 100644 index 0000000..6434baf --- /dev/null +++ b/generated/async/docs/CustomerSnapshot.md @@ -0,0 +1,107 @@ +# CustomerSnapshot + +A snapshot of the customer model which belongs to a document. This model is readonly and the state is final after finalization of the document. It's is identical to the state of the customer model at the time of finalization. Updates to the actual customer dataset won't affect this snapshot, however if you update the document the customer and therefore the customer snapshot may reflect a different state. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**acquire_options** | **int** | 1 = Empfehlung eines anderen Kunden, 2 = Zeitungsanzeige, 3 = Eigene Akquisition, 4 = Mitarbeiter Akquisition, 5 = Google, 6 = Gelbe Seiten, 7 = Kostenlose Internet Plattform, 8 = Bezahlte Internet Plattform | [optional] +**additional_groups_ids** | **List[int]** | | [optional] +**bank_account** | **str** | | [optional] +**bank_account_owner** | **str** | | [optional] +**bank_bic** | **str** | | [optional] +**bank_code** | **str** | | [optional] +**bank_iban** | **str** | | [optional] +**bank_name** | **str** | | [optional] +**birth_date** | **date** | | [optional] +**cash_allowance** | **float** | | [optional] +**cash_allowance_days** | **int** | | [optional] +**cash_discount** | **float** | | [optional] +**cash_discount_type** | **str** | | [optional] +**city** | **str** | | [optional] +**state** | **str** | | [optional] +**company_name** | **str** | | +**country** | **str** | | [optional] +**created_at** | **date** | | [optional] [readonly] +**updated_at** | **str** | | [optional] [readonly] +**delivery_title** | **str** | | [optional] +**delivery_city** | **str** | | [optional] +**delivery_state** | **str** | | [optional] +**delivery_company_name** | **str** | | [optional] +**delivery_country** | **str** | | [optional] +**delivery_first_name** | **str** | | [optional] +**delivery_last_name** | **str** | | [optional] +**delivery_personal** | **bool** | | [optional] +**delivery_salutation** | **int** | 0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family | [optional] +**delivery_street** | **str** | | [optional] +**delivery_suffix_1** | **str** | | [optional] +**delivery_suffix_2** | **str** | | [optional] +**delivery_zip_code** | **str** | | [optional] +**display_name** | **str** | | [optional] [readonly] +**emails** | **List[str]** | | [optional] +**fax** | **str** | | [optional] +**first_name** | **str** | | [optional] +**grace_period** | **int** | will be replaced by its alias due_in_days. | [optional] +**due_in_days** | **int** | due date in days | [optional] +**group_id** | **int** | | [optional] +**id** | **int** | | [optional] [readonly] +**info_1** | **str** | | [optional] +**info_2** | **str** | | [optional] +**internet** | **str** | | [optional] +**last_name** | **str** | | +**login_id** | **int** | | [optional] +**mobile** | **str** | | [optional] +**note** | **str** | | [optional] +**number** | **str** | Automatically generated if empty/omitted and when no type in query is provided or the type 'CUSTOMER', 'CUSTOMER,SUPPLIER' | [optional] +**supplier_number** | **str** | Automatically generated if the type SUPPLIER or 'CUSTOMER,SUPPLIER' is provided as query parameter and the field supplier_number is empty/omitted. | [optional] +**payment_options** | **int** | 1 = Stets pünktliche Zahlung, 2 = überwiegend pünktliche Zahlung, 3 = überwiegend verspätete Zahlung, 5 = Grundsätzlich verspätete Zahlung | [optional] +**personal** | **bool** | | [optional] [default to False] +**phone_1** | **str** | | [optional] +**phone_2** | **str** | | [optional] +**postbox** | **str** | | [optional] +**postbox_city** | **str** | | [optional] +**postbox_state** | **str** | | [optional] +**postbox_country** | **str** | | [optional] +**postbox_zip_code** | **str** | | [optional] +**sale_price_level** | **str** | | [optional] +**salutation** | **int** | 0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family | [optional] +**sepa_agreement** | **str** | BASIC = SEPA-Basislastschrift, COR1 = SEPA-Basislastschrift COR1 (deprecated use BASIC instead), COMPANY = SEPA-Firmenlastschrift, NULL = Noch kein Mandat erteilt | [optional] +**sepa_agreement_date** | **date** | | [optional] +**sepa_mandate_reference** | **str** | | [optional] +**since_date** | **date** | | [optional] +**street** | **str** | | [optional] +**suffix_1** | **str** | | [optional] +**suffix_2** | **str** | | [optional] +**tax_number** | **str** | | [optional] +**court** | **str** | | [optional] +**court_registry_number** | **str** | | [optional] +**tax_options** | **str** | nStb = Nicht steuerbar (Drittland), nStbUstID = Nicht steuerbar (EU mit USt-IdNr.), nStbNoneUstID = Nicht steuerbar (EU ohne USt-IdNr.), revc = Steuerschuldwechsel §13b (Inland), IG = Innergemeinschaftliche Lieferung, AL = Ausfuhrlieferung, sStfr = sonstige Steuerbefreiung, NULL = Umsatzsteuerpflichtig | [optional] +**title** | **str** | | [optional] +**archived** | **bool** | | [optional] +**vat_identifier** | **str** | | [optional] +**zip_code** | **str** | | [optional] +**document_pdf_type** | **str** | Type of PDF to use when sending a Document to the Customer. | [optional] [default to 'default'] +**buyer_reference** | **str** | Used as \"buyerReference\" in ZUGFeRD and as \"Leitweg-ID\" in the XRechnung format. | [optional] +**foreign_supplier_number** | **str** | The ID given to your company by the customer in his system. | [optional] + +## Example + +```python +from easybill_generated_async.models.customer_snapshot import CustomerSnapshot + +# TODO update the JSON string below +json = "{}" +# create an instance of CustomerSnapshot from a JSON string +customer_snapshot_instance = CustomerSnapshot.from_json(json) +# print the JSON string representation of the object +print(CustomerSnapshot.to_json()) + +# convert the object into a dict +customer_snapshot_dict = customer_snapshot_instance.to_dict() +# create an instance of CustomerSnapshot from a dict +customer_snapshot_from_dict = CustomerSnapshot.from_dict(customer_snapshot_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/Customers.md b/generated/async/docs/Customers.md new file mode 100644 index 0000000..0d83c06 --- /dev/null +++ b/generated/async/docs/Customers.md @@ -0,0 +1,33 @@ +# Customers + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Customer]**](Customer.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.customers import Customers + +# TODO update the JSON string below +json = "{}" +# create an instance of Customers from a JSON string +customers_instance = Customers.from_json(json) +# print the JSON string representation of the object +print(Customers.to_json()) + +# convert the object into a dict +customers_dict = customers_instance.to_dict() +# create an instance of Customers from a dict +customers_from_dict = Customers.from_dict(customers_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/Discount.md b/generated/async/docs/Discount.md new file mode 100644 index 0000000..ebcf415 --- /dev/null +++ b/generated/async/docs/Discount.md @@ -0,0 +1,32 @@ +# Discount + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**customer_id** | **int** | | +**discount** | **int** | The discount value depending on \"discount_type\". If not provided, inherits from customer when available | [optional] +**discount_type** | **str** | AMOUNT subtracts the value in \"discount\" from the total<br/> QUANTITY subtracts the value in \"discount\" multiplied by quantity<br/> PERCENT uses the value in \"discount\" as a percentage<br/> FIX sets the value in \"discount\" as the new price. If not provided, inherits from customer when available | [optional] [default to 'PERCENT'] + +## Example + +```python +from easybill_generated_async.models.discount import Discount + +# TODO update the JSON string below +json = "{}" +# create an instance of Discount from a JSON string +discount_instance = Discount.from_json(json) +# print the JSON string representation of the object +print(Discount.to_json()) + +# convert the object into a dict +discount_dict = discount_instance.to_dict() +# create an instance of Discount from a dict +discount_from_dict = Discount.from_dict(discount_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/DiscountApi.md b/generated/async/docs/DiscountApi.md new file mode 100644 index 0000000..f58acc7 --- /dev/null +++ b/generated/async/docs/DiscountApi.md @@ -0,0 +1,888 @@ +# easybill_generated_async.DiscountApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**discounts_position_get**](DiscountApi.md#discounts_position_get) | **GET** /discounts/position | Fetch list of position discounts +[**discounts_position_group_get**](DiscountApi.md#discounts_position_group_get) | **GET** /discounts/position-group | Fetch list of position-group discounts +[**discounts_position_group_id_delete**](DiscountApi.md#discounts_position_group_id_delete) | **DELETE** /discounts/position-group/{id} | Delete the specified position-group discount +[**discounts_position_group_id_get**](DiscountApi.md#discounts_position_group_id_get) | **GET** /discounts/position-group/{id} | Fetch specified position-group discount by id +[**discounts_position_group_id_put**](DiscountApi.md#discounts_position_group_id_put) | **PUT** /discounts/position-group/{id} | Update a position-group discount +[**discounts_position_group_post**](DiscountApi.md#discounts_position_group_post) | **POST** /discounts/position-group | Create a new position-group discount +[**discounts_position_id_delete**](DiscountApi.md#discounts_position_id_delete) | **DELETE** /discounts/position/{id} | Delete the specified position discount +[**discounts_position_id_get**](DiscountApi.md#discounts_position_id_get) | **GET** /discounts/position/{id} | Fetch specified position discount by id +[**discounts_position_id_put**](DiscountApi.md#discounts_position_id_put) | **PUT** /discounts/position/{id} | Update a position discount +[**discounts_position_post**](DiscountApi.md#discounts_position_post) | **POST** /discounts/position | Create a new position discount + + +# **discounts_position_get** +> DiscountPositions discounts_position_get(limit=limit, page=page, customer_id=customer_id) + +Fetch list of position discounts + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.discount_positions import DiscountPositions +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DiscountApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + customer_id = 'customer_id_example' # str | Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. (optional) + + try: + # Fetch list of position discounts + api_response = await api_instance.discounts_position_get(limit=limit, page=page, customer_id=customer_id) + print("The response of DiscountApi->discounts_position_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **customer_id** | **str**| Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. | [optional] + +### Return type + +[**DiscountPositions**](DiscountPositions.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_group_get** +> DiscountPositionGroups discounts_position_group_get(limit=limit, page=page, customer_id=customer_id) + +Fetch list of position-group discounts + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.discount_position_groups import DiscountPositionGroups +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DiscountApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + customer_id = 'customer_id_example' # str | Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. (optional) + + try: + # Fetch list of position-group discounts + api_response = await api_instance.discounts_position_group_get(limit=limit, page=page, customer_id=customer_id) + print("The response of DiscountApi->discounts_position_group_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_group_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **customer_id** | **str**| Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. | [optional] + +### Return type + +[**DiscountPositionGroups**](DiscountPositionGroups.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_group_id_delete** +> discounts_position_group_id_delete(id) + +Delete the specified position-group discount + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DiscountApi(api_client) + id = 56 # int | ID of the to be soon deleted discount + + try: + # Delete the specified position-group discount + await api_instance.discounts_position_group_id_delete(id) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_group_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the to be soon deleted discount | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_group_id_get** +> DiscountPositionGroup discounts_position_group_id_get(id, limit=limit, page=page) + +Fetch specified position-group discount by id + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.discount_position_group import DiscountPositionGroup +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DiscountApi(api_client) + id = 56 # int | ID of the discount + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch specified position-group discount by id + api_response = await api_instance.discounts_position_group_id_get(id, limit=limit, page=page) + print("The response of DiscountApi->discounts_position_group_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_group_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the discount | + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**DiscountPositionGroup**](DiscountPositionGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_group_id_put** +> DiscountPositionGroup discounts_position_group_id_put(id, body=body) + +Update a position-group discount + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.discount_position_group import DiscountPositionGroup +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DiscountApi(api_client) + id = 56 # int | ID of the to be soon updated discount + body = easybill_generated_async.DiscountPositionGroup() # DiscountPositionGroup | (optional) + + try: + # Update a position-group discount + api_response = await api_instance.discounts_position_group_id_put(id, body=body) + print("The response of DiscountApi->discounts_position_group_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_group_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the to be soon updated discount | + **body** | [**DiscountPositionGroup**](DiscountPositionGroup.md)| | [optional] + +### Return type + +[**DiscountPositionGroup**](DiscountPositionGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_group_post** +> DiscountPositionGroup discounts_position_group_post(body) + +Create a new position-group discount + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.discount_position_group import DiscountPositionGroup +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DiscountApi(api_client) + body = easybill_generated_async.DiscountPositionGroup() # DiscountPositionGroup | + + try: + # Create a new position-group discount + api_response = await api_instance.discounts_position_group_post(body) + print("The response of DiscountApi->discounts_position_group_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_group_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**DiscountPositionGroup**](DiscountPositionGroup.md)| | + +### Return type + +[**DiscountPositionGroup**](DiscountPositionGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_id_delete** +> discounts_position_id_delete(id) + +Delete the specified position discount + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DiscountApi(api_client) + id = 56 # int | ID of the to be soon deleted discount + + try: + # Delete the specified position discount + await api_instance.discounts_position_id_delete(id) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the to be soon deleted discount | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_id_get** +> DiscountPosition discounts_position_id_get(id, limit=limit, page=page) + +Fetch specified position discount by id + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.discount_position import DiscountPosition +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DiscountApi(api_client) + id = 56 # int | ID of the discount + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch specified position discount by id + api_response = await api_instance.discounts_position_id_get(id, limit=limit, page=page) + print("The response of DiscountApi->discounts_position_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the discount | + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**DiscountPosition**](DiscountPosition.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_id_put** +> DiscountPosition discounts_position_id_put(id, body=body) + +Update a position discount + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.discount_position import DiscountPosition +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DiscountApi(api_client) + id = 56 # int | ID of the to be soon updated discount + body = easybill_generated_async.DiscountPosition() # DiscountPosition | (optional) + + try: + # Update a position discount + api_response = await api_instance.discounts_position_id_put(id, body=body) + print("The response of DiscountApi->discounts_position_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the to be soon updated discount | + **body** | [**DiscountPosition**](DiscountPosition.md)| | [optional] + +### Return type + +[**DiscountPosition**](DiscountPosition.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_post** +> DiscountPosition discounts_position_post(body) + +Create a new position discount + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.discount_position import DiscountPosition +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DiscountApi(api_client) + body = easybill_generated_async.DiscountPosition() # DiscountPosition | + + try: + # Create a new position discount + api_response = await api_instance.discounts_position_post(body) + print("The response of DiscountApi->discounts_position_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**DiscountPosition**](DiscountPosition.md)| | + +### Return type + +[**DiscountPosition**](DiscountPosition.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/DiscountPosition.md b/generated/async/docs/DiscountPosition.md new file mode 100644 index 0000000..80922f5 --- /dev/null +++ b/generated/async/docs/DiscountPosition.md @@ -0,0 +1,33 @@ +# DiscountPosition + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**customer_id** | **int** | | +**discount** | **int** | The discount value depending on \"discount_type\". If not provided, inherits from customer when available | [optional] +**discount_type** | **str** | AMOUNT subtracts the value in \"discount\" from the total<br/> QUANTITY subtracts the value in \"discount\" multiplied by quantity<br/> PERCENT uses the value in \"discount\" as a percentage<br/> FIX sets the value in \"discount\" as the new price. If not provided, inherits from customer when available | [optional] [default to 'PERCENT'] +**position_id** | **int** | | + +## Example + +```python +from easybill_generated_async.models.discount_position import DiscountPosition + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscountPosition from a JSON string +discount_position_instance = DiscountPosition.from_json(json) +# print the JSON string representation of the object +print(DiscountPosition.to_json()) + +# convert the object into a dict +discount_position_dict = discount_position_instance.to_dict() +# create an instance of DiscountPosition from a dict +discount_position_from_dict = DiscountPosition.from_dict(discount_position_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/DiscountPositionGroup.md b/generated/async/docs/DiscountPositionGroup.md new file mode 100644 index 0000000..aef364d --- /dev/null +++ b/generated/async/docs/DiscountPositionGroup.md @@ -0,0 +1,33 @@ +# DiscountPositionGroup + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**customer_id** | **int** | | +**discount** | **int** | The discount value depending on \"discount_type\". If not provided, inherits from customer when available | [optional] +**discount_type** | **str** | AMOUNT subtracts the value in \"discount\" from the total<br/> QUANTITY subtracts the value in \"discount\" multiplied by quantity<br/> PERCENT uses the value in \"discount\" as a percentage<br/> FIX sets the value in \"discount\" as the new price. If not provided, inherits from customer when available | [optional] [default to 'PERCENT'] +**position_group_id** | **int** | | + +## Example + +```python +from easybill_generated_async.models.discount_position_group import DiscountPositionGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscountPositionGroup from a JSON string +discount_position_group_instance = DiscountPositionGroup.from_json(json) +# print the JSON string representation of the object +print(DiscountPositionGroup.to_json()) + +# convert the object into a dict +discount_position_group_dict = discount_position_group_instance.to_dict() +# create an instance of DiscountPositionGroup from a dict +discount_position_group_from_dict = DiscountPositionGroup.from_dict(discount_position_group_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/DiscountPositionGroups.md b/generated/async/docs/DiscountPositionGroups.md new file mode 100644 index 0000000..f681753 --- /dev/null +++ b/generated/async/docs/DiscountPositionGroups.md @@ -0,0 +1,33 @@ +# DiscountPositionGroups + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[DiscountPositionGroup]**](DiscountPositionGroup.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.discount_position_groups import DiscountPositionGroups + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscountPositionGroups from a JSON string +discount_position_groups_instance = DiscountPositionGroups.from_json(json) +# print the JSON string representation of the object +print(DiscountPositionGroups.to_json()) + +# convert the object into a dict +discount_position_groups_dict = discount_position_groups_instance.to_dict() +# create an instance of DiscountPositionGroups from a dict +discount_position_groups_from_dict = DiscountPositionGroups.from_dict(discount_position_groups_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/DiscountPositions.md b/generated/async/docs/DiscountPositions.md new file mode 100644 index 0000000..ff16e48 --- /dev/null +++ b/generated/async/docs/DiscountPositions.md @@ -0,0 +1,33 @@ +# DiscountPositions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[DiscountPosition]**](DiscountPosition.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.discount_positions import DiscountPositions + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscountPositions from a JSON string +discount_positions_instance = DiscountPositions.from_json(json) +# print the JSON string representation of the object +print(DiscountPositions.to_json()) + +# convert the object into a dict +discount_positions_dict = discount_positions_instance.to_dict() +# create an instance of DiscountPositions from a dict +discount_positions_from_dict = DiscountPositions.from_dict(discount_positions_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/Document.md b/generated/async/docs/Document.md new file mode 100644 index 0000000..87f30fa --- /dev/null +++ b/generated/async/docs/Document.md @@ -0,0 +1,97 @@ +# Document + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**DocumentAddress**](DocumentAddress.md) | | [optional] +**advanced_data_fields** | [**List[AdvancedDataField]**](AdvancedDataField.md) | EN16931 Business Terms (BT fields) for structured invoice data. On update the submitted list fully replaces the existing fields — send an empty array to clear all. | [optional] +**attachment_ids** | **List[int]** | | [optional] [readonly] +**label_address** | [**DocumentAddress**](DocumentAddress.md) | | [optional] +**amount** | **int** | Amount in cents (e.g. \"150\" = 1.50€) | [optional] [readonly] +**amount_net** | **int** | Amount in cents (e.g. \"150\" = 1.50€) | [optional] [readonly] +**anonymize_due_date** | **date** | A date which signals when to anonymize the document. Must be in the future. Turns into a read only field if the document is anonymized | [optional] +**anonymize_status** | **str** | This field signals if the document was anonymized | [optional] [readonly] [default to 'NOT_ANONYMIZED'] +**anonymized_at** | **str** | | [optional] [readonly] +**bank_debit_form** | **str** | | [optional] [default to 'null'] +**billing_country** | **str** | | [optional] [readonly] +**calc_vat_from** | **int** | 0 === Net, 1 === Gross. | [optional] +**cancel_id** | **int** | ID from the cancel document. Only for document type INVOICE. | [optional] [readonly] +**cash_allowance** | **float** | Cash allowance percentage. If not provided, inherits from customer when available. | [optional] +**cash_allowance_days** | **int** | Days for cash allowance. If not provided, inherits from customer when available. | [optional] +**cash_allowance_text** | **str** | | [optional] [default to 'null'] +**contact_id** | **int** | | [optional] +**contact_label** | **str** | | [optional] [default to ''] +**contact_text** | **str** | | [optional] [default to ''] +**created_at** | **datetime** | | [optional] [readonly] +**currency** | **str** | | [optional] [default to 'EUR'] +**customer_id** | **int** | | [optional] +**customer_snapshot** | [**CustomerSnapshot**](CustomerSnapshot.md) | | [optional] +**discount** | **str** | | [optional] [default to 'null'] +**discount_type** | **str** | | [optional] [default to null] +**document_date** | **date** | | [optional] +**due_date** | **date** | To change the value use grace_period. | [optional] [readonly] +**edited_at** | **datetime** | | [optional] [readonly] +**external_id** | **str** | | [optional] [default to 'null'] +**replica_url** | **str** | | [optional] [default to 'null'] +**grace_period** | **int** | will be replaced by its alias due_in_days. | [optional] +**due_in_days** | **int** | due date in days. If not provided, inherits from customer when available | [optional] +**id** | **int** | | [optional] [readonly] +**is_acceptable_on_public_domain** | **bool** | Indicates if a document can be accepted by the end customer through the document's public access page. | [optional] [default to False] +**is_archive** | **bool** | | [optional] [default to False] +**is_draft** | **bool** | This property is read only. To finish the document call /documents/{id}/done. | [optional] [readonly] +**is_replica** | **bool** | Marks a document as a replica from another software. | [optional] [default to False] +**is_oss** | **bool** | Indicates if a document is a one-stop-shop document | [optional] [default to False] +**item_notes** | **List[str]** | Field holds all unique document_note of items for the document | [optional] [readonly] +**items** | [**List[DocumentPosition]**](DocumentPosition.md) | | [optional] +**last_postbox_id** | **int** | | [optional] [readonly] +**login_id** | **int** | If omitted or null, the currently active login is used. | [optional] +**number** | **str** | | [optional] [default to 'null'] +**order_number** | **str** | | [optional] [default to ''] +**buyer_reference** | **str** | | [optional] [default to ''] +**paid_amount** | **int** | | [optional] [readonly] +**paid_at** | **date** | | [optional] [readonly] +**pdf_pages** | **int** | | [optional] [readonly] +**pdf_template** | **str** | Default template is null or 'DE', default english is 'EN' and for all others use the numeric template ID. | [optional] +**payment_link_enabled** | **bool** | Whether the payment link is shown on this document. Overrides the setting from the referenced template. | [optional] [default to False] +**payment_link_locale** | **str** | Language of the payment link text on the document. | [optional] [default to 'de'] +**project_id** | **int** | | [optional] +**recurring_options** | [**DocumentRecurring**](DocumentRecurring.md) | | [optional] +**ref_id** | **int** | Reference document id | [optional] +**root_id** | **int** | Root document id | [optional] [readonly] +**service_date** | [**ServiceDate**](ServiceDate.md) | | [optional] +**shipping_country** | **str** | | [optional] [default to 'null'] +**status** | **str** | This value can only be used in document type DELIVERY, ORDER, CHARGE or OFFER. NULL is default = not set. | [optional] [default to null] +**text** | **str** | | [optional] +**text_prefix** | **str** | | [optional] +**text_tax** | **str** | Overwrites the default vat-option text from the document layout. It is only displayed in documents with the type other than: Delivery, Dunning, Reminder or Letter and a different vat-option than null | [optional] [default to 'null'] +**title** | **str** | | [optional] [default to 'null'] +**type** | **str** | Can only set on create. | [optional] [default to 'INVOICE'] +**use_shipping_address** | **bool** | If true and customer has shipping address then it will be used. | [optional] [default to False] +**vat_country** | **str** | | [optional] [default to 'null'] +**vat_id** | **str** | | [optional] [readonly] [default to ''] +**fulfillment_country** | **str** | | [optional] [default to 'null'] +**vat_option** | **str** | NULL: Normal steuerbar<br/> nStb: Nicht steuerbar (Drittland)<br/> nStbUstID: Nicht steuerbar (EU mit USt-IdNr.)<br/> nStbNoneUstID: Nicht steuerbar (EU ohne USt-IdNr.)<br/> nStbIm: Nicht steuerbarer Innenumsatz<br/> revc: Steuerschuldwechsel §13b (Inland)<br/> IG: Innergemeinschaftliche Lieferung<br/> AL: Ausfuhrlieferung<br/> sStfr: sonstige Steuerbefreiung<br/> smallBusiness: Kleinunternehmen (Keine MwSt.) | [optional] [default to null] +**file_format_config** | [**List[FileFormatConfig]**](FileFormatConfig.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.document import Document + +# TODO update the JSON string below +json = "{}" +# create an instance of Document from a JSON string +document_instance = Document.from_json(json) +# print the JSON string representation of the object +print(Document.to_json()) + +# convert the object into a dict +document_dict = document_instance.to_dict() +# create an instance of Document from a dict +document_from_dict = Document.from_dict(document_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/DocumentAddress.md b/generated/async/docs/DocumentAddress.md new file mode 100644 index 0000000..07043f9 --- /dev/null +++ b/generated/async/docs/DocumentAddress.md @@ -0,0 +1,42 @@ +# DocumentAddress + +This information comes from the customer which can be set with customer_id. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**salutation** | **int** | 0: empty<br/> 1: Herrn<br/> 2: Frau<br/> 3: Firma<br/> 4: Herrn und Frau<br/> 5: Eheleute<br/> 6: Familie | [optional] [readonly] +**personal** | **bool** | | [optional] [readonly] +**title** | **str** | | [optional] [readonly] +**first_name** | **str** | | [optional] [readonly] +**last_name** | **str** | | [optional] [readonly] +**suffix_1** | **str** | | [optional] [readonly] +**suffix_2** | **str** | | [optional] [readonly] +**company_name** | **str** | | [optional] [readonly] +**street** | **str** | | [optional] [readonly] +**zip_code** | **str** | | [optional] [readonly] +**city** | **str** | | [optional] [readonly] +**state** | **str** | | [optional] [readonly] +**country** | **str** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_async.models.document_address import DocumentAddress + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentAddress from a JSON string +document_address_instance = DocumentAddress.from_json(json) +# print the JSON string representation of the object +print(DocumentAddress.to_json()) + +# convert the object into a dict +document_address_dict = document_address_instance.to_dict() +# create an instance of DocumentAddress from a dict +document_address_from_dict = DocumentAddress.from_dict(document_address_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/DocumentApi.md b/generated/async/docs/DocumentApi.md new file mode 100644 index 0000000..95c401c --- /dev/null +++ b/generated/async/docs/DocumentApi.md @@ -0,0 +1,1104 @@ +# easybill_generated_async.DocumentApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**documents_get**](DocumentApi.md#documents_get) | **GET** /documents | Fetch documents list +[**documents_id_cancel_post**](DocumentApi.md#documents_id_cancel_post) | **POST** /documents/{id}/cancel | Cancel document +[**documents_id_delete**](DocumentApi.md#documents_id_delete) | **DELETE** /documents/{id} | Delete document +[**documents_id_done_put**](DocumentApi.md#documents_id_done_put) | **PUT** /documents/{id}/done | To complete a document. +[**documents_id_download_get**](DocumentApi.md#documents_id_download_get) | **GET** /documents/{id}/download | Fetch the document in best fitting format to the given Accept header +[**documents_id_get**](DocumentApi.md#documents_id_get) | **GET** /documents/{id} | Fetch document +[**documents_id_jpg_get**](DocumentApi.md#documents_id_jpg_get) | **GET** /documents/{id}/jpg | Download a document as an jpeg-image +[**documents_id_pdf_get**](DocumentApi.md#documents_id_pdf_get) | **GET** /documents/{id}/pdf | Fetch pdf document +[**documents_id_put**](DocumentApi.md#documents_id_put) | **PUT** /documents/{id} | Update document +[**documents_id_send_type_post**](DocumentApi.md#documents_id_send_type_post) | **POST** /documents/{id}/send/{type} | Send document +[**documents_id_type_post**](DocumentApi.md#documents_id_type_post) | **POST** /documents/{id}/{type} | Convert an existing document to one of a different type +[**documents_post**](DocumentApi.md#documents_post) | **POST** /documents | Create document + + +# **documents_get** +> Documents documents_get(limit=limit, page=page, type=type, is_draft=is_draft, is_archive=is_archive, customer_id=customer_id, project_id=project_id, ref_id=ref_id, document_date=document_date, paid_at=paid_at, title=title, number=number, cancel_id=cancel_id, fulfillment_country=fulfillment_country, vat_country=vat_country, shipping_country=shipping_country, status=status, edited_at=edited_at) + +Fetch documents list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.documents import Documents +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + type = 'type_example' # str | Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT. (optional) + is_draft = 'is_draft_example' # str | Filter documents by draft flag. (optional) + is_archive = 'is_archive_example' # str | Filter documents by archive flag. (optional) + customer_id = 'customer_id_example' # str | Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id. (optional) + project_id = 'project_id_example' # str | Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id. (optional) + ref_id = 'ref_id_example' # str | Filter documents by ref_id. (optional) + document_date = 'document_date_example' # str | Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31. (optional) + paid_at = 'paid_at_example' # str | Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents. (optional) + title = 'title_example' # str | Filter documents by title. (optional) + number = 'number_example' # str | Filter documents by number. (optional) + cancel_id = 'cancel_id_example' # str | Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents. (optional) + fulfillment_country = 'fulfillment_country_example' # str | Filter documents by fulfillment_country. (optional) + vat_country = 'vat_country_example' # str | Filter documents by vat_country. (optional) + shipping_country = 'shipping_country_example' # str | Filter documents by shipping_country. (optional) + status = 'status_example' # str | Filter documents by status. Keep in mind that not every document type has a status. (optional) + edited_at = 'edited_at_example' # str | Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31. (optional) + + try: + # Fetch documents list + api_response = await api_instance.documents_get(limit=limit, page=page, type=type, is_draft=is_draft, is_archive=is_archive, customer_id=customer_id, project_id=project_id, ref_id=ref_id, document_date=document_date, paid_at=paid_at, title=title, number=number, cancel_id=cancel_id, fulfillment_country=fulfillment_country, vat_country=vat_country, shipping_country=shipping_country, status=status, edited_at=edited_at) + print("The response of DocumentApi->documents_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **type** | **str**| Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT. | [optional] + **is_draft** | **str**| Filter documents by draft flag. | [optional] + **is_archive** | **str**| Filter documents by archive flag. | [optional] + **customer_id** | **str**| Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id. | [optional] + **project_id** | **str**| Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id. | [optional] + **ref_id** | **str**| Filter documents by ref_id. | [optional] + **document_date** | **str**| Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31. | [optional] + **paid_at** | **str**| Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents. | [optional] + **title** | **str**| Filter documents by title. | [optional] + **number** | **str**| Filter documents by number. | [optional] + **cancel_id** | **str**| Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents. | [optional] + **fulfillment_country** | **str**| Filter documents by fulfillment_country. | [optional] + **vat_country** | **str**| Filter documents by vat_country. | [optional] + **shipping_country** | **str**| Filter documents by shipping_country. | [optional] + **status** | **str**| Filter documents by status. Keep in mind that not every document type has a status. | [optional] + **edited_at** | **str**| Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31. | [optional] + +### Return type + +[**Documents**](Documents.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_cancel_post** +> Document documents_id_cancel_post(id, use_text_from_template=use_text_from_template) + +Cancel document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.document import Document +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentApi(api_client) + id = 56 # int | ID of document + use_text_from_template = False # bool | Use standard texts from the template. (optional) (default to False) + + try: + # Cancel document + api_response = await api_instance.documents_id_cancel_post(id, use_text_from_template=use_text_from_template) + print("The response of DocumentApi->documents_id_cancel_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_cancel_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **use_text_from_template** | **bool**| Use standard texts from the template. | [optional] [default to False] + +### Return type + +[**Document**](Document.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_delete** +> documents_id_delete(id) + +Delete document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentApi(api_client) + id = 56 # int | ID of document + + try: + # Delete document + await api_instance.documents_id_delete(id) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**409** | Resource is locked. This status is returned if a process is currently running which locks the requested resource. Try again later. | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_done_put** +> Document documents_id_done_put(id, reason_for_change=reason_for_change) + +To complete a document. + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.document import Document +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentApi(api_client) + id = 56 # int | ID of document + reason_for_change = 'reason_for_change_example' # str | A string that is saved on the document version as reason. (optional) + + try: + # To complete a document. + api_response = await api_instance.documents_id_done_put(id, reason_for_change=reason_for_change) + print("The response of DocumentApi->documents_id_done_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_done_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **reason_for_change** | **str**| A string that is saved on the document version as reason. | [optional] + +### Return type + +[**Document**](Document.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**409** | Resource is locked. This status is returned if a process is currently running which locks the requested resource. Try again later. | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_download_get** +> bytes documents_id_download_get(id, accept=accept) + +Fetch the document in best fitting format to the given Accept header + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentApi(api_client) + id = 56 # int | ID of document + accept = 'accept_example' # str | The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher. (optional) + + try: + # Fetch the document in best fitting format to the given Accept header + api_response = await api_instance.documents_id_download_get(id, accept=accept) + print("The response of DocumentApi->documents_id_download_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_download_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **accept** | **str**| The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher. | [optional] + +### Return type + +**bytes** + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/pdf, application/pdf;format=zugferd;version=1.0.0, application/pdf;format=zugferd;version=2.2.0, application/xml;format=xrechnung;version=2.3.0, application/xml;format=xrechnung;version=3.0.1 + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation, a binary matching the defined expectations via 'Accept' header could be found and will be returned. The 'Content-Type' header of the response will contain the exact pdf format provided. | - | +**404** | Not found | - | +**406** | No matching format of the document is available | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_get** +> Document documents_id_get(id) + +Fetch document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.document import Document +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentApi(api_client) + id = 56 # int | ID of document + + try: + # Fetch document + api_response = await api_instance.documents_id_get(id) + print("The response of DocumentApi->documents_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + +### Return type + +[**Document**](Document.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_jpg_get** +> bytes documents_id_jpg_get(id, offset=offset, limit=limit) + +Download a document as an jpeg-image + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentApi(api_client) + id = 56 # int | ID of document + offset = 56 # int | The page of the document where the image should start. (optional) + limit = 56 # int | The page of the document where the image should end. (optional) + + try: + # Download a document as an jpeg-image + api_response = await api_instance.documents_id_jpg_get(id, offset=offset, limit=limit) + print("The response of DocumentApi->documents_id_jpg_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_jpg_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **offset** | **int**| The page of the document where the image should start. | [optional] + **limit** | **int**| The page of the document where the image should end. | [optional] + +### Return type + +**bytes** + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: image/jpeg + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_pdf_get** +> bytes documents_id_pdf_get(id) + +Fetch pdf document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentApi(api_client) + id = 56 # int | ID of document + + try: + # Fetch pdf document + api_response = await api_instance.documents_id_pdf_get(id) + print("The response of DocumentApi->documents_id_pdf_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_pdf_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + +### Return type + +**bytes** + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/pdf + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_put** +> Document documents_id_put(id, body, refresh_customer_data=refresh_customer_data, reason_for_change=reason_for_change) + +Update document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.document import Document +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentApi(api_client) + id = 56 # int | ID of document + body = easybill_generated_async.Document() # Document | + refresh_customer_data = True # bool | Forces refreshing of the customer data. (optional) + reason_for_change = 'reason_for_change_example' # str | A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value. (optional) + + try: + # Update document + api_response = await api_instance.documents_id_put(id, body, refresh_customer_data=refresh_customer_data, reason_for_change=reason_for_change) + print("The response of DocumentApi->documents_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **body** | [**Document**](Document.md)| | + **refresh_customer_data** | **bool**| Forces refreshing of the customer data. | [optional] + **reason_for_change** | **str**| A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value. | [optional] + +### Return type + +[**Document**](Document.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid Document | - | +**409** | Resource is locked. This status is returned if a process is currently running which locks the requested resource. Try again later. | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_send_type_post** +> documents_id_send_type_post(id, type, body) + +Send document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.post_box_request import PostBoxRequest +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentApi(api_client) + id = 56 # int | ID of document + type = 'type_example' # str | + body = easybill_generated_async.PostBoxRequest() # PostBoxRequest | + + try: + # Send document + await api_instance.documents_id_send_type_post(id, type, body) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_send_type_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **type** | **str**| | + **body** | [**PostBoxRequest**](PostBoxRequest.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_type_post** +> Document documents_id_type_post(id, type, pdf_template=pdf_template) + +Convert an existing document to one of a different type + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.document import Document +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentApi(api_client) + id = 56 # int | ID of document + type = 'type_example' # str | The target document type + pdf_template = 'DE' # str | The ID of the printer template to use. Defaults to 'DE' if not given. (optional) (default to 'DE') + + try: + # Convert an existing document to one of a different type + api_response = await api_instance.documents_id_type_post(id, type, pdf_template=pdf_template) + print("The response of DocumentApi->documents_id_type_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_type_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **type** | **str**| The target document type | + **pdf_template** | **str**| The ID of the printer template to use. Defaults to 'DE' if not given. | [optional] [default to 'DE'] + +### Return type + +[**Document**](Document.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | * Location - Absolute URL to the newly created document
| +**400** | Invalid target document type | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_post** +> Document documents_post(body) + +Create document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.document import Document +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentApi(api_client) + body = easybill_generated_async.Document() # Document | + + try: + # Create document + api_response = await api_instance.documents_post(body) + print("The response of DocumentApi->documents_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Document**](Document.md)| | + +### Return type + +[**Document**](Document.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/DocumentPayment.md b/generated/async/docs/DocumentPayment.md new file mode 100644 index 0000000..fd5b13b --- /dev/null +++ b/generated/async/docs/DocumentPayment.md @@ -0,0 +1,38 @@ +# DocumentPayment + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **int** | | +**document_id** | **int** | | +**id** | **int** | | [optional] [readonly] +**is_overdue_fee** | **bool** | | [optional] +**login_id** | **int** | | [optional] [readonly] +**notice** | **str** | | [optional] [default to ''] +**payment_at** | **date** | | [optional] +**type** | **str** | | [optional] [default to ''] +**provider** | **str** | | [optional] [default to ''] +**reference** | **str** | | [optional] [default to ''] + +## Example + +```python +from easybill_generated_async.models.document_payment import DocumentPayment + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentPayment from a JSON string +document_payment_instance = DocumentPayment.from_json(json) +# print the JSON string representation of the object +print(DocumentPayment.to_json()) + +# convert the object into a dict +document_payment_dict = document_payment_instance.to_dict() +# create an instance of DocumentPayment from a dict +document_payment_from_dict = DocumentPayment.from_dict(document_payment_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/DocumentPaymentApi.md b/generated/async/docs/DocumentPaymentApi.md new file mode 100644 index 0000000..cf2ddec --- /dev/null +++ b/generated/async/docs/DocumentPaymentApi.md @@ -0,0 +1,361 @@ +# easybill_generated_async.DocumentPaymentApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**document_payments_get**](DocumentPaymentApi.md#document_payments_get) | **GET** /document-payments | Fetch document payments list +[**document_payments_id_delete**](DocumentPaymentApi.md#document_payments_id_delete) | **DELETE** /document-payments/{id} | Delete document payment +[**document_payments_id_get**](DocumentPaymentApi.md#document_payments_id_get) | **GET** /document-payments/{id} | Fetch document payment +[**document_payments_post**](DocumentPaymentApi.md#document_payments_post) | **POST** /document-payments | Create document payment + + +# **document_payments_get** +> DocumentPayments document_payments_get(limit=limit, page=page, document_id=document_id, payment_at=payment_at, reference=reference) + +Fetch document payments list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.document_payments import DocumentPayments +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentPaymentApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + document_id = 'document_id_example' # str | Filter payments by document_id. You can add multiple ids separate by comma like id,id,id. (optional) + payment_at = 'payment_at_example' # str | Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31. (optional) + reference = 'reference_example' # str | Filter payments by reference. You can add multiple references separate by comma like id,id,id. (optional) + + try: + # Fetch document payments list + api_response = await api_instance.document_payments_get(limit=limit, page=page, document_id=document_id, payment_at=payment_at, reference=reference) + print("The response of DocumentPaymentApi->document_payments_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentPaymentApi->document_payments_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **document_id** | **str**| Filter payments by document_id. You can add multiple ids separate by comma like id,id,id. | [optional] + **payment_at** | **str**| Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31. | [optional] + **reference** | **str**| Filter payments by reference. You can add multiple references separate by comma like id,id,id. | [optional] + +### Return type + +[**DocumentPayments**](DocumentPayments.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **document_payments_id_delete** +> document_payments_id_delete(id) + +Delete document payment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentPaymentApi(api_client) + id = 56 # int | ID of document payment + + try: + # Delete document payment + await api_instance.document_payments_id_delete(id) + except Exception as e: + print("Exception when calling DocumentPaymentApi->document_payments_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document payment | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **document_payments_id_get** +> DocumentPayment document_payments_id_get(id) + +Fetch document payment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.document_payment import DocumentPayment +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentPaymentApi(api_client) + id = 56 # int | ID of document payment + + try: + # Fetch document payment + api_response = await api_instance.document_payments_id_get(id) + print("The response of DocumentPaymentApi->document_payments_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentPaymentApi->document_payments_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document payment | + +### Return type + +[**DocumentPayment**](DocumentPayment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **document_payments_post** +> DocumentPayment document_payments_post(body, paid=paid) + +Create document payment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.document_payment import DocumentPayment +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentPaymentApi(api_client) + body = easybill_generated_async.DocumentPayment() # DocumentPayment | + paid = True # bool | Mark document as paid when amount less then payment amount. (optional) + + try: + # Create document payment + api_response = await api_instance.document_payments_post(body, paid=paid) + print("The response of DocumentPaymentApi->document_payments_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentPaymentApi->document_payments_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**DocumentPayment**](DocumentPayment.md)| | + **paid** | **bool**| Mark document as paid when amount less then payment amount. | [optional] + +### Return type + +[**DocumentPayment**](DocumentPayment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/DocumentPayments.md b/generated/async/docs/DocumentPayments.md new file mode 100644 index 0000000..7efe91f --- /dev/null +++ b/generated/async/docs/DocumentPayments.md @@ -0,0 +1,33 @@ +# DocumentPayments + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[DocumentPayment]**](DocumentPayment.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.document_payments import DocumentPayments + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentPayments from a JSON string +document_payments_instance = DocumentPayments.from_json(json) +# print the JSON string representation of the object +print(DocumentPayments.to_json()) + +# convert the object into a dict +document_payments_dict = document_payments_instance.to_dict() +# create an instance of DocumentPayments from a dict +document_payments_from_dict = DocumentPayments.from_dict(document_payments_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/DocumentPosition.md b/generated/async/docs/DocumentPosition.md new file mode 100644 index 0000000..379fb73 --- /dev/null +++ b/generated/async/docs/DocumentPosition.md @@ -0,0 +1,56 @@ +# DocumentPosition + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **str** | | [optional] [default to 'null'] +**description** | **str** | | [optional] [default to 'null'] +**document_note** | **str** | This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction. | [optional] +**quantity** | **float** | | [optional] [default to 1.0] +**quantity_str** | **str** | Use quantity_str if you want to set a quantity like: 1:30 h or 3x5 m. quantity_str overwrites quantity. | [optional] +**unit** | **str** | | [optional] [default to 'null'] +**type** | **str** | | [optional] [default to 'POSITION'] +**position** | **int** | Automatic by default (first item: 1, second item: 2, ...) | [optional] +**single_price_net** | **float** | Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€) | [optional] +**single_price_gross** | **float** | Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€) | [optional] +**vat_percent** | **float** | | [optional] [default to 0.0] +**discount** | **float** | | [optional] +**discount_type** | **str** | | [optional] [default to null] +**position_id** | **int** | If set, values are copied from the referenced position | [optional] +**total_price_net** | **float** | Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€) | [optional] [readonly] +**total_price_gross** | **float** | Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€) | [optional] [readonly] +**total_vat** | **float** | | [optional] [readonly] +**serial_number_id** | **str** | | [optional] [readonly] +**serial_number** | **str** | | [optional] [readonly] +**booking_account** | **str** | | [optional] [default to 'null'] +**export_cost_1** | **str** | | [optional] [default to 'null'] +**export_cost_2** | **str** | | [optional] [default to 'null'] +**cost_price_net** | **float** | Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€) | [optional] +**cost_price_total** | **float** | Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€) | [optional] [readonly] +**cost_price_charge** | **float** | | [optional] [readonly] +**cost_price_charge_type** | **str** | | [optional] [readonly] +**item_type** | **str** | | [optional] [default to 'UNDEFINED'] +**id** | **int** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_async.models.document_position import DocumentPosition + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentPosition from a JSON string +document_position_instance = DocumentPosition.from_json(json) +# print the JSON string representation of the object +print(DocumentPosition.to_json()) + +# convert the object into a dict +document_position_dict = document_position_instance.to_dict() +# create an instance of DocumentPosition from a dict +document_position_from_dict = DocumentPosition.from_dict(document_position_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/DocumentRecurring.md b/generated/async/docs/DocumentRecurring.md new file mode 100644 index 0000000..fc90bbf --- /dev/null +++ b/generated/async/docs/DocumentRecurring.md @@ -0,0 +1,47 @@ +# DocumentRecurring + +This object is only available in document type RECURRING. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_date** | **date** | Must be in the future | +**frequency** | **str** | | [optional] [default to 'MONTHLY'] +**frequency_special** | **str** | | [optional] [default to null] +**interval** | **int** | | [optional] +**end_date_or_count** | **str** | Date of last exectution day or number of times to exectute | [optional] [default to 'null'] +**status** | **str** | | [optional] [default to 'WAITING'] +**as_draft** | **bool** | | [optional] [default to False] +**is_notify** | **bool** | | [optional] [default to False] +**send_as** | **str** | | [optional] [default to null] +**is_sign** | **bool** | | [optional] [default to False] +**is_paid** | **bool** | | [optional] [default to False] +**paid_date_option** | **str** | Option is used to determine what date is used for the payment if is_paid is true. \"next_valid_date\" selects the next workday in regards to the created date of the document if the date falls on a saturday or sunday. | [optional] [default to 'created_date'] +**is_sepa** | **bool** | | [optional] [default to False] +**sepa_local_instrument** | **str** | COR1 is deprecated use CORE instead. | [optional] [default to null] +**sepa_sequence_type** | **str** | | [optional] [default to null] +**sepa_reference** | **str** | | [optional] [default to 'null'] +**sepa_remittance_information** | **str** | | [optional] [default to 'null'] +**target_type** | **str** | The document type that will be generated. Can not be changed on existing documents. | [optional] [default to 'INVOICE'] + +## Example + +```python +from easybill_generated_async.models.document_recurring import DocumentRecurring + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentRecurring from a JSON string +document_recurring_instance = DocumentRecurring.from_json(json) +# print the JSON string representation of the object +print(DocumentRecurring.to_json()) + +# convert the object into a dict +document_recurring_dict = document_recurring_instance.to_dict() +# create an instance of DocumentRecurring from a dict +document_recurring_from_dict = DocumentRecurring.from_dict(document_recurring_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/DocumentVersion.md b/generated/async/docs/DocumentVersion.md new file mode 100644 index 0000000..44485a3 --- /dev/null +++ b/generated/async/docs/DocumentVersion.md @@ -0,0 +1,33 @@ +# DocumentVersion + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] [readonly] +**document_id** | **int** | | [optional] [readonly] +**id** | **int** | | [optional] [readonly] +**items** | [**List[DocumentVersionItem]**](DocumentVersionItem.md) | | [optional] +**reason** | **str** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_async.models.document_version import DocumentVersion + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentVersion from a JSON string +document_version_instance = DocumentVersion.from_json(json) +# print the JSON string representation of the object +print(DocumentVersion.to_json()) + +# convert the object into a dict +document_version_dict = document_version_instance.to_dict() +# create an instance of DocumentVersion from a dict +document_version_from_dict = DocumentVersion.from_dict(document_version_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/DocumentVersionApi.md b/generated/async/docs/DocumentVersionApi.md new file mode 100644 index 0000000..3e5909e --- /dev/null +++ b/generated/async/docs/DocumentVersionApi.md @@ -0,0 +1,277 @@ +# easybill_generated_async.DocumentVersionApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**documents_id_versions_get**](DocumentVersionApi.md#documents_id_versions_get) | **GET** /documents/{id}/versions | List all versions of a given document +[**documents_id_versions_version_id_get**](DocumentVersionApi.md#documents_id_versions_version_id_get) | **GET** /documents/{id}/versions/{versionId} | Show a single version of a given document +[**documents_id_versions_version_id_items_version_item_id_download_get**](DocumentVersionApi.md#documents_id_versions_version_id_items_version_item_id_download_get) | **GET** /documents/{id}/versions/{versionId}/items/{versionItemId}/download | Download a specific file for a single version of a given document + + +# **documents_id_versions_get** +> DocumentVersions documents_id_versions_get(id, limit=limit, page=page) + +List all versions of a given document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.document_versions import DocumentVersions +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentVersionApi(api_client) + id = 56 # int | ID of document + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # List all versions of a given document + api_response = await api_instance.documents_id_versions_get(id, limit=limit, page=page) + print("The response of DocumentVersionApi->documents_id_versions_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentVersionApi->documents_id_versions_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**DocumentVersions**](DocumentVersions.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_versions_version_id_get** +> DocumentVersion documents_id_versions_version_id_get(id, version_id) + +Show a single version of a given document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.document_version import DocumentVersion +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentVersionApi(api_client) + id = 56 # int | ID of document + version_id = 56 # int | ID of document version + + try: + # Show a single version of a given document + api_response = await api_instance.documents_id_versions_version_id_get(id, version_id) + print("The response of DocumentVersionApi->documents_id_versions_version_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentVersionApi->documents_id_versions_version_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **version_id** | **int**| ID of document version | + +### Return type + +[**DocumentVersion**](DocumentVersion.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Document Version does not exist | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_versions_version_id_items_version_item_id_download_get** +> bytes documents_id_versions_version_id_items_version_item_id_download_get(id, version_id, version_item_id) + +Download a specific file for a single version of a given document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.DocumentVersionApi(api_client) + id = 56 # int | ID of document + version_id = 56 # int | ID of document version + version_item_id = 56 # int | ID of document version item + + try: + # Download a specific file for a single version of a given document + api_response = await api_instance.documents_id_versions_version_id_items_version_item_id_download_get(id, version_id, version_item_id) + print("The response of DocumentVersionApi->documents_id_versions_version_id_items_version_item_id_download_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentVersionApi->documents_id_versions_version_id_items_version_item_id_download_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **version_id** | **int**| ID of document version | + **version_item_id** | **int**| ID of document version item | + +### Return type + +**bytes** + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/pdf, text/xml + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Document Version does not exist | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/DocumentVersionItem.md b/generated/async/docs/DocumentVersionItem.md new file mode 100644 index 0000000..6e7c91f --- /dev/null +++ b/generated/async/docs/DocumentVersionItem.md @@ -0,0 +1,30 @@ +# DocumentVersionItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**document_version_item_type** | **str** | | [optional] [readonly] +**id** | **int** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_async.models.document_version_item import DocumentVersionItem + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentVersionItem from a JSON string +document_version_item_instance = DocumentVersionItem.from_json(json) +# print the JSON string representation of the object +print(DocumentVersionItem.to_json()) + +# convert the object into a dict +document_version_item_dict = document_version_item_instance.to_dict() +# create an instance of DocumentVersionItem from a dict +document_version_item_from_dict = DocumentVersionItem.from_dict(document_version_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/DocumentVersions.md b/generated/async/docs/DocumentVersions.md new file mode 100644 index 0000000..b14ab89 --- /dev/null +++ b/generated/async/docs/DocumentVersions.md @@ -0,0 +1,33 @@ +# DocumentVersions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[DocumentVersion]**](DocumentVersion.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.document_versions import DocumentVersions + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentVersions from a JSON string +document_versions_instance = DocumentVersions.from_json(json) +# print the JSON string representation of the object +print(DocumentVersions.to_json()) + +# convert the object into a dict +document_versions_dict = document_versions_instance.to_dict() +# create an instance of DocumentVersions from a dict +document_versions_from_dict = DocumentVersions.from_dict(document_versions_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/Documents.md b/generated/async/docs/Documents.md new file mode 100644 index 0000000..d8caf46 --- /dev/null +++ b/generated/async/docs/Documents.md @@ -0,0 +1,33 @@ +# Documents + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Document]**](Document.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.documents import Documents + +# TODO update the JSON string below +json = "{}" +# create an instance of Documents from a JSON string +documents_instance = Documents.from_json(json) +# print the JSON string representation of the object +print(Documents.to_json()) + +# convert the object into a dict +documents_dict = documents_instance.to_dict() +# create an instance of Documents from a dict +documents_from_dict = Documents.from_dict(documents_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/FileFormatConfig.md b/generated/async/docs/FileFormatConfig.md new file mode 100644 index 0000000..6c2543d --- /dev/null +++ b/generated/async/docs/FileFormatConfig.md @@ -0,0 +1,29 @@ +# FileFormatConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | + +## Example + +```python +from easybill_generated_async.models.file_format_config import FileFormatConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of FileFormatConfig from a JSON string +file_format_config_instance = FileFormatConfig.from_json(json) +# print the JSON string representation of the object +print(FileFormatConfig.to_json()) + +# convert the object into a dict +file_format_config_dict = file_format_config_instance.to_dict() +# create an instance of FileFormatConfig from a dict +file_format_config_from_dict = FileFormatConfig.from_dict(file_format_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/List.md b/generated/async/docs/List.md new file mode 100644 index 0000000..627eb54 --- /dev/null +++ b/generated/async/docs/List.md @@ -0,0 +1,32 @@ +# List + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | + +## Example + +```python +from easybill_generated_async.models.list import List + +# TODO update the JSON string below +json = "{}" +# create an instance of List from a JSON string +list_instance = List.from_json(json) +# print the JSON string representation of the object +print(List.to_json()) + +# convert the object into a dict +list_dict = list_instance.to_dict() +# create an instance of List from a dict +list_from_dict = List.from_dict(list_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/Login.md b/generated/async/docs/Login.md new file mode 100644 index 0000000..309aab5 --- /dev/null +++ b/generated/async/docs/Login.md @@ -0,0 +1,39 @@ +# Login + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**first_name** | **str** | | [optional] +**last_name** | **str** | | [optional] +**display_name** | **str** | | [optional] [readonly] +**phone** | **str** | | [optional] +**email** | **str** | | [optional] +**email_signature** | **str** | | [optional] +**login_type** | **str** | | [optional] [default to 'ASSISTANT'] +**locale** | **str** | | [optional] +**time_zone** | **str** | | [optional] +**security** | [**LoginSecurity**](LoginSecurity.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.login import Login + +# TODO update the JSON string below +json = "{}" +# create an instance of Login from a JSON string +login_instance = Login.from_json(json) +# print the JSON string representation of the object +print(Login.to_json()) + +# convert the object into a dict +login_dict = login_instance.to_dict() +# create an instance of Login from a dict +login_from_dict = Login.from_dict(login_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/LoginSecurity.md b/generated/async/docs/LoginSecurity.md new file mode 100644 index 0000000..5782067 --- /dev/null +++ b/generated/async/docs/LoginSecurity.md @@ -0,0 +1,32 @@ +# LoginSecurity + +This object is only displayed if your request the login resource as an admin. Otherwise this property will be null. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**two_factor_enabled** | **bool** | Shows if the login has two factor enabled for the login process | [optional] [readonly] [default to False] +**recovery_codes_enabled** | **bool** | Shows if the login has recovery codes enabled to bypass two factor | [optional] [readonly] [default to False] +**notify_on_new_login_enabled** | **bool** | Shows if the login has enabled to be notified if a new login is made from an unknown device. | [optional] [readonly] [default to True] + +## Example + +```python +from easybill_generated_async.models.login_security import LoginSecurity + +# TODO update the JSON string below +json = "{}" +# create an instance of LoginSecurity from a JSON string +login_security_instance = LoginSecurity.from_json(json) +# print the JSON string representation of the object +print(LoginSecurity.to_json()) + +# convert the object into a dict +login_security_dict = login_security_instance.to_dict() +# create an instance of LoginSecurity from a dict +login_security_from_dict = LoginSecurity.from_dict(login_security_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/Logins.md b/generated/async/docs/Logins.md new file mode 100644 index 0000000..2cec3d8 --- /dev/null +++ b/generated/async/docs/Logins.md @@ -0,0 +1,33 @@ +# Logins + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Login]**](Login.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.logins import Logins + +# TODO update the JSON string below +json = "{}" +# create an instance of Logins from a JSON string +logins_instance = Logins.from_json(json) +# print the JSON string representation of the object +print(Logins.to_json()) + +# convert the object into a dict +logins_dict = logins_instance.to_dict() +# create an instance of Logins from a dict +logins_from_dict = Logins.from_dict(logins_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/LoginsApi.md b/generated/async/docs/LoginsApi.md new file mode 100644 index 0000000..7f2aa70 --- /dev/null +++ b/generated/async/docs/LoginsApi.md @@ -0,0 +1,176 @@ +# easybill_generated_async.LoginsApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**logins_get**](LoginsApi.md#logins_get) | **GET** /logins | +[**logins_id_get**](LoginsApi.md#logins_id_get) | **GET** /logins/{id} | + + +# **logins_get** +> Logins logins_get(limit=limit, page=page) + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.logins import Logins +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.LoginsApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + api_response = await api_instance.logins_get(limit=limit, page=page) + print("The response of LoginsApi->logins_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LoginsApi->logins_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**Logins**](Logins.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logins_id_get** +> Login logins_id_get(id) + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.login import Login +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.LoginsApi(api_client) + id = 56 # int | ID of the login that needs to be fetched + + try: + api_response = await api_instance.logins_id_get(id) + print("The response of LoginsApi->logins_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LoginsApi->logins_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the login that needs to be fetched | + +### Return type + +[**Login**](Login.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/PDFTemplate.md b/generated/async/docs/PDFTemplate.md new file mode 100644 index 0000000..0bfff5d --- /dev/null +++ b/generated/async/docs/PDFTemplate.md @@ -0,0 +1,33 @@ +# PDFTemplate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] [default to 'INVOICE-DE'] +**name** | **str** | | [optional] [default to 'Default template'] +**pdf_template** | **str** | | [optional] [default to 'DE'] +**document_type** | **str** | | [optional] [default to 'INVOICE'] +**settings** | [**PDFTemplateSettings**](PDFTemplateSettings.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.pdf_template import PDFTemplate + +# TODO update the JSON string below +json = "{}" +# create an instance of PDFTemplate from a JSON string +pdf_template_instance = PDFTemplate.from_json(json) +# print the JSON string representation of the object +print(PDFTemplate.to_json()) + +# convert the object into a dict +pdf_template_dict = pdf_template_instance.to_dict() +# create an instance of PDFTemplate from a dict +pdf_template_from_dict = PDFTemplate.from_dict(pdf_template_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/PDFTemplateSettings.md b/generated/async/docs/PDFTemplateSettings.md new file mode 100644 index 0000000..f0d3b5d --- /dev/null +++ b/generated/async/docs/PDFTemplateSettings.md @@ -0,0 +1,31 @@ +# PDFTemplateSettings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**text_prefix** | **str** | | [optional] [default to ''] +**text** | **str** | | [optional] [default to ''] +**email** | [**PDFTemplateSettingsEmail**](PDFTemplateSettingsEmail.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.pdf_template_settings import PDFTemplateSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of PDFTemplateSettings from a JSON string +pdf_template_settings_instance = PDFTemplateSettings.from_json(json) +# print the JSON string representation of the object +print(PDFTemplateSettings.to_json()) + +# convert the object into a dict +pdf_template_settings_dict = pdf_template_settings_instance.to_dict() +# create an instance of PDFTemplateSettings from a dict +pdf_template_settings_from_dict = PDFTemplateSettings.from_dict(pdf_template_settings_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/PDFTemplateSettingsEmail.md b/generated/async/docs/PDFTemplateSettingsEmail.md new file mode 100644 index 0000000..6cc345e --- /dev/null +++ b/generated/async/docs/PDFTemplateSettingsEmail.md @@ -0,0 +1,30 @@ +# PDFTemplateSettingsEmail + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**subject** | **str** | | [optional] [default to ''] +**message** | **str** | | [optional] [default to ''] + +## Example + +```python +from easybill_generated_async.models.pdf_template_settings_email import PDFTemplateSettingsEmail + +# TODO update the JSON string below +json = "{}" +# create an instance of PDFTemplateSettingsEmail from a JSON string +pdf_template_settings_email_instance = PDFTemplateSettingsEmail.from_json(json) +# print the JSON string representation of the object +print(PDFTemplateSettingsEmail.to_json()) + +# convert the object into a dict +pdf_template_settings_email_dict = pdf_template_settings_email_instance.to_dict() +# create an instance of PDFTemplateSettingsEmail from a dict +pdf_template_settings_email_from_dict = PDFTemplateSettingsEmail.from_dict(pdf_template_settings_email_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/PDFTemplates.md b/generated/async/docs/PDFTemplates.md new file mode 100644 index 0000000..0603a7a --- /dev/null +++ b/generated/async/docs/PDFTemplates.md @@ -0,0 +1,29 @@ +# PDFTemplates + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**List[PDFTemplate]**](PDFTemplate.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.pdf_templates import PDFTemplates + +# TODO update the JSON string below +json = "{}" +# create an instance of PDFTemplates from a JSON string +pdf_templates_instance = PDFTemplates.from_json(json) +# print the JSON string representation of the object +print(PDFTemplates.to_json()) + +# convert the object into a dict +pdf_templates_dict = pdf_templates_instance.to_dict() +# create an instance of PDFTemplates from a dict +pdf_templates_from_dict = PDFTemplates.from_dict(pdf_templates_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/PdfTemplatesApi.md b/generated/async/docs/PdfTemplatesApi.md new file mode 100644 index 0000000..f08c00a --- /dev/null +++ b/generated/async/docs/PdfTemplatesApi.md @@ -0,0 +1,94 @@ +# easybill_generated_async.PdfTemplatesApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**pdf_templates_get**](PdfTemplatesApi.md#pdf_templates_get) | **GET** /pdf-templates | Fetch PDF Templates list + + +# **pdf_templates_get** +> PDFTemplates pdf_templates_get(type=type) + +Fetch PDF Templates list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.pdf_templates import PDFTemplates +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.PdfTemplatesApi(api_client) + type = ['type_example'] # List[str] | Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type. (optional) + + try: + # Fetch PDF Templates list + api_response = await api_instance.pdf_templates_get(type=type) + print("The response of PdfTemplatesApi->pdf_templates_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PdfTemplatesApi->pdf_templates_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **type** | [**List[str]**](str.md)| Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type. | [optional] + +### Return type + +[**PDFTemplates**](PDFTemplates.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/Position.md b/generated/async/docs/Position.md new file mode 100644 index 0000000..0fe7781 --- /dev/null +++ b/generated/async/docs/Position.md @@ -0,0 +1,61 @@ +# Position + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**type** | **str** | | [optional] [default to 'PRODUCT'] +**number** | **str** | | +**description** | **str** | The positions name or description | +**document_note** | **str** | This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction. | [optional] +**note** | **str** | Note for internal use | [optional] [default to 'null'] +**unit** | **str** | | [optional] [default to 'null'] +**export_identifier** | **str** | The FAS-Account is the four-digit revenue account, in which the revenue will be entered when doing the export to your tax consultant. In case you want to split your revenue to several revenue accounts, please talk to your tax consultant before, to guarantee an unobstructed use of the interface. For every revenue element, there are number ranges, which can be used. Please avoid using combinations of numbers, which can not be used by your tax consultant. | [optional] [default to 'null'] +**export_identifier_extended** | [**PositionExportIdentifierExtended**](PositionExportIdentifierExtended.md) | | [optional] +**login_id** | **int** | | [optional] [readonly] +**price_type** | **str** | | [optional] [default to 'NETTO'] +**vat_percent** | **float** | | [optional] [default to 19.0] +**sale_price** | **float** | Price in cents (e.g. \"150\" = 1.50€) | +**sale_price2** | **float** | Price for customers of group 2 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price3** | **float** | Price for customers of group 3 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price4** | **float** | Price for customers of group 4 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price5** | **float** | Price for customers of group 5 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price6** | **float** | Price for customers of group 6 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price7** | **float** | Price for customers of group 7 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price8** | **float** | Price for customers of group 8 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price9** | **float** | Price for customers of group 9 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price10** | **float** | Price for customers of group 10 in cents (e.g. \"150\" = 1.50€) | [optional] +**cost_price** | **float** | Price in cents (e.g. \"150\" = 1.50€) | [optional] +**export_cost1** | **str** | | [optional] [default to 'null'] +**export_cost2** | **str** | | [optional] [default to 'null'] +**group_id** | **int** | | [optional] +**stock** | **str** | Activates stock management for this position | [optional] [default to 'NO'] +**stock_count** | **int** | Current stock count | [optional] [readonly] +**stock_limit_notify** | **bool** | Notify when stock_count is lower than stock_limit | [optional] [default to False] +**stock_limit_notify_frequency** | **str** | Notify frequency when stock_count is lower than stock_limit (ALWAYS, ONCE) | [optional] [default to 'ALWAYS'] +**stock_limit** | **int** | | [optional] +**quantity** | **float** | Used as the default quantity when adding this position to a document | [optional] +**archived** | **bool** | | [optional] [default to False] + +## Example + +```python +from easybill_generated_async.models.position import Position + +# TODO update the JSON string below +json = "{}" +# create an instance of Position from a JSON string +position_instance = Position.from_json(json) +# print the JSON string representation of the object +print(Position.to_json()) + +# convert the object into a dict +position_dict = position_instance.to_dict() +# create an instance of Position from a dict +position_from_dict = Position.from_dict(position_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/PositionApi.md b/generated/async/docs/PositionApi.md new file mode 100644 index 0000000..b7a8c49 --- /dev/null +++ b/generated/async/docs/PositionApi.md @@ -0,0 +1,446 @@ +# easybill_generated_async.PositionApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**positions_get**](PositionApi.md#positions_get) | **GET** /positions | Fetch positions list +[**positions_id_delete**](PositionApi.md#positions_id_delete) | **DELETE** /positions/{id} | Delete position +[**positions_id_get**](PositionApi.md#positions_id_get) | **GET** /positions/{id} | Fetch position +[**positions_id_put**](PositionApi.md#positions_id_put) | **PUT** /positions/{id} | Update position +[**positions_post**](PositionApi.md#positions_post) | **POST** /positions | Create position + + +# **positions_get** +> Positions positions_get(limit=limit, page=page, type=type, number=number) + +Fetch positions list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.positions import Positions +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.PositionApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + type = 'type_example' # str | Filter positions by type. (optional) + number = 'number_example' # str | Filter positions by number. You can add multiple numbers separate by comma like no,no,no. (optional) + + try: + # Fetch positions list + api_response = await api_instance.positions_get(limit=limit, page=page, type=type, number=number) + print("The response of PositionApi->positions_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionApi->positions_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **type** | **str**| Filter positions by type. | [optional] + **number** | **str**| Filter positions by number. You can add multiple numbers separate by comma like no,no,no. | [optional] + +### Return type + +[**Positions**](Positions.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **positions_id_delete** +> positions_id_delete(id) + +Delete position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.PositionApi(api_client) + id = 56 # int | ID of position + + try: + # Delete position + await api_instance.positions_id_delete(id) + except Exception as e: + print("Exception when calling PositionApi->positions_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of position | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **positions_id_get** +> Position positions_id_get(id) + +Fetch position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.position import Position +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.PositionApi(api_client) + id = 56 # int | ID of position + + try: + # Fetch position + api_response = await api_instance.positions_id_get(id) + print("The response of PositionApi->positions_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionApi->positions_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of position | + +### Return type + +[**Position**](Position.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **positions_id_put** +> Position positions_id_put(id, body) + +Update position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.position import Position +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.PositionApi(api_client) + id = 56 # int | ID of position + body = easybill_generated_async.Position() # Position | + + try: + # Update position + api_response = await api_instance.positions_id_put(id, body) + print("The response of PositionApi->positions_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionApi->positions_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of position | + **body** | [**Position**](Position.md)| | + +### Return type + +[**Position**](Position.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid position | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **positions_post** +> Position positions_post(body) + +Create position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.position import Position +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.PositionApi(api_client) + body = easybill_generated_async.Position() # Position | + + try: + # Create position + api_response = await api_instance.positions_post(body) + print("The response of PositionApi->positions_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionApi->positions_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Position**](Position.md)| | + +### Return type + +[**Position**](Position.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/PositionExportIdentifierExtended.md b/generated/async/docs/PositionExportIdentifierExtended.md new file mode 100644 index 0000000..6c682a6 --- /dev/null +++ b/generated/async/docs/PositionExportIdentifierExtended.md @@ -0,0 +1,38 @@ +# PositionExportIdentifierExtended + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**null** | **str** | Umsatzsteuerpflichtig | [optional] [default to 'null'] +**n_stb** | **str** | Nicht steuerbar (Drittland) | [optional] [default to 'null'] +**n_stb_ust_id** | **str** | Nicht steuerbar (EU mit USt-IdNr.) | [optional] [default to 'null'] +**n_stb_none_ust_id** | **str** | Nicht steuerbar (EU ohne USt-IdNr.) | [optional] [default to 'null'] +**n_stb_im** | **str** | Nicht steuerbarer Innenumsatz | [optional] [default to 'null'] +**revc** | **str** | Steuerschuldwechsel §13b (Inland) | [optional] [default to 'null'] +**ig** | **str** | Innergemeinschaftliche Lieferung | [optional] [default to 'null'] +**al** | **str** | Ausfuhrlieferung | [optional] [default to 'null'] +**s_stfr** | **str** | sonstige Steuerbefreiung | [optional] [default to 'null'] +**small_business** | **str** | Kleinunternehmen (Keine MwSt.) | [optional] [default to 'null'] + +## Example + +```python +from easybill_generated_async.models.position_export_identifier_extended import PositionExportIdentifierExtended + +# TODO update the JSON string below +json = "{}" +# create an instance of PositionExportIdentifierExtended from a JSON string +position_export_identifier_extended_instance = PositionExportIdentifierExtended.from_json(json) +# print the JSON string representation of the object +print(PositionExportIdentifierExtended.to_json()) + +# convert the object into a dict +position_export_identifier_extended_dict = position_export_identifier_extended_instance.to_dict() +# create an instance of PositionExportIdentifierExtended from a dict +position_export_identifier_extended_from_dict = PositionExportIdentifierExtended.from_dict(position_export_identifier_extended_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/PositionGroup.md b/generated/async/docs/PositionGroup.md new file mode 100644 index 0000000..b17537b --- /dev/null +++ b/generated/async/docs/PositionGroup.md @@ -0,0 +1,34 @@ +# PositionGroup + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] [default to 'null'] +**login_id** | **int** | | [optional] [readonly] +**name** | **str** | | +**number** | **str** | | +**display_name** | **str** | | [optional] [readonly] +**id** | **int** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_async.models.position_group import PositionGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of PositionGroup from a JSON string +position_group_instance = PositionGroup.from_json(json) +# print the JSON string representation of the object +print(PositionGroup.to_json()) + +# convert the object into a dict +position_group_dict = position_group_instance.to_dict() +# create an instance of PositionGroup from a dict +position_group_from_dict = PositionGroup.from_dict(position_group_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/PositionGroupApi.md b/generated/async/docs/PositionGroupApi.md new file mode 100644 index 0000000..2ec04a5 --- /dev/null +++ b/generated/async/docs/PositionGroupApi.md @@ -0,0 +1,442 @@ +# easybill_generated_async.PositionGroupApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**position_groups_get**](PositionGroupApi.md#position_groups_get) | **GET** /position-groups | Fetch position group list +[**position_groups_id_delete**](PositionGroupApi.md#position_groups_id_delete) | **DELETE** /position-groups/{id} | Delete position group +[**position_groups_id_get**](PositionGroupApi.md#position_groups_id_get) | **GET** /position-groups/{id} | Fetch position group +[**position_groups_id_put**](PositionGroupApi.md#position_groups_id_put) | **PUT** /position-groups/{id} | Update position group +[**position_groups_post**](PositionGroupApi.md#position_groups_post) | **POST** /position-groups | Create position group + + +# **position_groups_get** +> PositionGroups position_groups_get(limit=limit, page=page) + +Fetch position group list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.position_groups import PositionGroups +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.PositionGroupApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch position group list + api_response = await api_instance.position_groups_get(limit=limit, page=page) + print("The response of PositionGroupApi->position_groups_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionGroupApi->position_groups_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**PositionGroups**](PositionGroups.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **position_groups_id_delete** +> position_groups_id_delete(id) + +Delete position group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.PositionGroupApi(api_client) + id = 56 # int | ID of position group + + try: + # Delete position group + await api_instance.position_groups_id_delete(id) + except Exception as e: + print("Exception when calling PositionGroupApi->position_groups_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of position group | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **position_groups_id_get** +> PositionGroup position_groups_id_get(id) + +Fetch position group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.position_group import PositionGroup +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.PositionGroupApi(api_client) + id = 56 # int | ID of position group + + try: + # Fetch position group + api_response = await api_instance.position_groups_id_get(id) + print("The response of PositionGroupApi->position_groups_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionGroupApi->position_groups_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of position group | + +### Return type + +[**PositionGroup**](PositionGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **position_groups_id_put** +> PositionGroup position_groups_id_put(id, body) + +Update position group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.position_group import PositionGroup +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.PositionGroupApi(api_client) + id = 56 # int | ID of position goup + body = easybill_generated_async.PositionGroup() # PositionGroup | + + try: + # Update position group + api_response = await api_instance.position_groups_id_put(id, body) + print("The response of PositionGroupApi->position_groups_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionGroupApi->position_groups_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of position goup | + **body** | [**PositionGroup**](PositionGroup.md)| | + +### Return type + +[**PositionGroup**](PositionGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid position group | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **position_groups_post** +> PositionGroup position_groups_post(body) + +Create position group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.position_group import PositionGroup +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.PositionGroupApi(api_client) + body = easybill_generated_async.PositionGroup() # PositionGroup | + + try: + # Create position group + api_response = await api_instance.position_groups_post(body) + print("The response of PositionGroupApi->position_groups_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionGroupApi->position_groups_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**PositionGroup**](PositionGroup.md)| | + +### Return type + +[**PositionGroup**](PositionGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/PositionGroups.md b/generated/async/docs/PositionGroups.md new file mode 100644 index 0000000..b20a45c --- /dev/null +++ b/generated/async/docs/PositionGroups.md @@ -0,0 +1,33 @@ +# PositionGroups + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[PositionGroup]**](PositionGroup.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.position_groups import PositionGroups + +# TODO update the JSON string below +json = "{}" +# create an instance of PositionGroups from a JSON string +position_groups_instance = PositionGroups.from_json(json) +# print the JSON string representation of the object +print(PositionGroups.to_json()) + +# convert the object into a dict +position_groups_dict = position_groups_instance.to_dict() +# create an instance of PositionGroups from a dict +position_groups_from_dict = PositionGroups.from_dict(position_groups_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/Positions.md b/generated/async/docs/Positions.md new file mode 100644 index 0000000..81faebd --- /dev/null +++ b/generated/async/docs/Positions.md @@ -0,0 +1,33 @@ +# Positions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Position]**](Position.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.positions import Positions + +# TODO update the JSON string below +json = "{}" +# create an instance of Positions from a JSON string +positions_instance = Positions.from_json(json) +# print the JSON string representation of the object +print(Positions.to_json()) + +# convert the object into a dict +positions_dict = positions_instance.to_dict() +# create an instance of Positions from a dict +positions_from_dict = Positions.from_dict(positions_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/PostBox.md b/generated/async/docs/PostBox.md new file mode 100644 index 0000000..c050337 --- /dev/null +++ b/generated/async/docs/PostBox.md @@ -0,0 +1,47 @@ +# PostBox + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**document_id** | **int** | | [optional] +**to** | **str** | | [optional] +**cc** | **str** | | [optional] +**var_from** | **str** | | [optional] +**subject** | **str** | | [optional] +**message** | **str** | | [optional] +**var_date** | **date** | | [optional] +**created_at** | **datetime** | | [optional] +**processed_at** | **datetime** | | [optional] +**send_by_self** | **bool** | | [optional] +**send_with_attachment** | **bool** | | [optional] +**type** | **str** | | [optional] +**status** | **str** | | [optional] +**status_msg** | **str** | | [optional] +**login_id** | **int** | | [optional] [readonly] +**document_file_type** | **str** | | [optional] +**post_send_type** | **str** | This value indicates what method is used when the document is send via mail. The different types are offered by the german post as additional services. The registered mail options will include a tracking number which will be added to the postbox when known. If the value is omitted or empty when a postbox is created with the type \"POST\" post_send_type_standard will be used. For postbox with a different type than \"POST\" this field will hold a empty string. | [optional] +**tracking_identifier** | **str** | If the document is send with one of the registered send types stated for post_send_type, a tracking identifier will be added to the postbox at a later point when the tracking identifier is provided by our service partner. | [optional] [readonly] + +## Example + +```python +from easybill_generated_async.models.post_box import PostBox + +# TODO update the JSON string below +json = "{}" +# create an instance of PostBox from a JSON string +post_box_instance = PostBox.from_json(json) +# print the JSON string representation of the object +print(PostBox.to_json()) + +# convert the object into a dict +post_box_dict = post_box_instance.to_dict() +# create an instance of PostBox from a dict +post_box_from_dict = PostBox.from_dict(post_box_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/PostBoxApi.md b/generated/async/docs/PostBoxApi.md new file mode 100644 index 0000000..8622fa4 --- /dev/null +++ b/generated/async/docs/PostBoxApi.md @@ -0,0 +1,273 @@ +# easybill_generated_async.PostBoxApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_boxes_get**](PostBoxApi.md#post_boxes_get) | **GET** /post-boxes | Fetch post box list +[**post_boxes_id_delete**](PostBoxApi.md#post_boxes_id_delete) | **DELETE** /post-boxes/{id} | Delete post box +[**post_boxes_id_get**](PostBoxApi.md#post_boxes_id_get) | **GET** /post-boxes/{id} | Fetch post box + + +# **post_boxes_get** +> PostBoxes post_boxes_get(limit=limit, page=page, type=type, status=status, document_id=document_id) + +Fetch post box list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.post_boxes import PostBoxes +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.PostBoxApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + type = 'type_example' # str | Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX. (optional) + status = 'status_example' # str | Filter post boxes by status. (optional) + document_id = 'document_id_example' # str | Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id. (optional) + + try: + # Fetch post box list + api_response = await api_instance.post_boxes_get(limit=limit, page=page, type=type, status=status, document_id=document_id) + print("The response of PostBoxApi->post_boxes_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PostBoxApi->post_boxes_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **type** | **str**| Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX. | [optional] + **status** | **str**| Filter post boxes by status. | [optional] + **document_id** | **str**| Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id. | [optional] + +### Return type + +[**PostBoxes**](PostBoxes.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_boxes_id_delete** +> post_boxes_id_delete(id) + +Delete post box + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.PostBoxApi(api_client) + id = 56 # int | ID of post box + + try: + # Delete post box + await api_instance.post_boxes_id_delete(id) + except Exception as e: + print("Exception when calling PostBoxApi->post_boxes_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of post box | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_boxes_id_get** +> PostBox post_boxes_id_get(id) + +Fetch post box + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.post_box import PostBox +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.PostBoxApi(api_client) + id = 56 # int | ID of post box + + try: + # Fetch post box + api_response = await api_instance.post_boxes_id_get(id) + print("The response of PostBoxApi->post_boxes_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PostBoxApi->post_boxes_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of post box | + +### Return type + +[**PostBox**](PostBox.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/PostBoxRequest.md b/generated/async/docs/PostBoxRequest.md new file mode 100644 index 0000000..eb51f0f --- /dev/null +++ b/generated/async/docs/PostBoxRequest.md @@ -0,0 +1,38 @@ +# PostBoxRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**to** | **str** | | [optional] +**cc** | **str** | | [optional] +**var_from** | **str** | | [optional] +**subject** | **str** | | [optional] +**message** | **str** | | [optional] +**var_date** | **date** | | [optional] +**send_by_self** | **bool** | | [optional] +**send_with_attachment** | **bool** | | [optional] [default to True] +**document_file_type** | **str** | When set to null, the setting on the customer is used | [optional] +**post_send_type** | **str** | This value indicates what method is used when the document is send via mail. The different types are offered by the german post as additional services. The registered mail options will include a tracking number which will be added to the postbox when known. If the value is omitted or empty when a postbox is created with the type \"POST\" post_send_type_standard will be used. For postbox with a different type than \"POST\" this field will hold a empty string. | [optional] + +## Example + +```python +from easybill_generated_async.models.post_box_request import PostBoxRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of PostBoxRequest from a JSON string +post_box_request_instance = PostBoxRequest.from_json(json) +# print the JSON string representation of the object +print(PostBoxRequest.to_json()) + +# convert the object into a dict +post_box_request_dict = post_box_request_instance.to_dict() +# create an instance of PostBoxRequest from a dict +post_box_request_from_dict = PostBoxRequest.from_dict(post_box_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/PostBoxes.md b/generated/async/docs/PostBoxes.md new file mode 100644 index 0000000..72fb121 --- /dev/null +++ b/generated/async/docs/PostBoxes.md @@ -0,0 +1,33 @@ +# PostBoxes + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[PostBox]**](PostBox.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.post_boxes import PostBoxes + +# TODO update the JSON string below +json = "{}" +# create an instance of PostBoxes from a JSON string +post_boxes_instance = PostBoxes.from_json(json) +# print the JSON string representation of the object +print(PostBoxes.to_json()) + +# convert the object into a dict +post_boxes_dict = post_boxes_instance.to_dict() +# create an instance of PostBoxes from a dict +post_boxes_from_dict = PostBoxes.from_dict(post_boxes_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/Project.md b/generated/async/docs/Project.md new file mode 100644 index 0000000..dc5b775 --- /dev/null +++ b/generated/async/docs/Project.md @@ -0,0 +1,41 @@ +# Project + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**budget_amount** | **int** | Project budget in cents (e.g. \"150\" = 1.50€) | [optional] +**budget_time** | **int** | Time budget in minutes (e.g. \"90\" = 1 hour and 30 minutes) | [optional] +**customer_id** | **int** | | [optional] +**hourly_rate** | **float** | Hourly rate in cents (e.g. \"150\" = 1.50€) | [optional] +**id** | **int** | | [optional] [readonly] +**login_id** | **int** | If omitted or null, the currently active login is used | [optional] +**name** | **str** | | +**note** | **str** | | [optional] [default to 'null'] +**status** | **str** | | [optional] [default to 'OPEN'] +**due_at** | **date** | | [optional] +**budget_notify_frequency** | **str** | | [optional] [default to 'ALWAYS'] +**consumed_time** | **int** | | [optional] [readonly] +**consumed_amount** | **int** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_async.models.project import Project + +# TODO update the JSON string below +json = "{}" +# create an instance of Project from a JSON string +project_instance = Project.from_json(json) +# print the JSON string representation of the object +print(Project.to_json()) + +# convert the object into a dict +project_dict = project_instance.to_dict() +# create an instance of Project from a dict +project_from_dict = Project.from_dict(project_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/ProjectApi.md b/generated/async/docs/ProjectApi.md new file mode 100644 index 0000000..4597860 --- /dev/null +++ b/generated/async/docs/ProjectApi.md @@ -0,0 +1,446 @@ +# easybill_generated_async.ProjectApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**projects_get**](ProjectApi.md#projects_get) | **GET** /projects | Fetch projects list +[**projects_id_delete**](ProjectApi.md#projects_id_delete) | **DELETE** /projects/{id} | Delete project +[**projects_id_get**](ProjectApi.md#projects_id_get) | **GET** /projects/{id} | Fetch project +[**projects_id_put**](ProjectApi.md#projects_id_put) | **PUT** /projects/{id} | Update project +[**projects_post**](ProjectApi.md#projects_post) | **POST** /projects | Create project + + +# **projects_get** +> Projects projects_get(limit=limit, page=page, customer_id=customer_id, status=status) + +Fetch projects list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.projects import Projects +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.ProjectApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + customer_id = 'customer_id_example' # str | Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id. (optional) + status = 'status_example' # str | Filter projects by status. (optional) + + try: + # Fetch projects list + api_response = await api_instance.projects_get(limit=limit, page=page, customer_id=customer_id, status=status) + print("The response of ProjectApi->projects_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->projects_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **customer_id** | **str**| Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id. | [optional] + **status** | **str**| Filter projects by status. | [optional] + +### Return type + +[**Projects**](Projects.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **projects_id_delete** +> projects_id_delete(id) + +Delete project + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.ProjectApi(api_client) + id = 56 # int | ID of project + + try: + # Delete project + await api_instance.projects_id_delete(id) + except Exception as e: + print("Exception when calling ProjectApi->projects_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of project | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **projects_id_get** +> Project projects_id_get(id) + +Fetch project + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.project import Project +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.ProjectApi(api_client) + id = 56 # int | ID of project + + try: + # Fetch project + api_response = await api_instance.projects_id_get(id) + print("The response of ProjectApi->projects_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->projects_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of project | + +### Return type + +[**Project**](Project.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **projects_id_put** +> Project projects_id_put(id, body) + +Update project + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.project import Project +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.ProjectApi(api_client) + id = 56 # int | ID of project + body = easybill_generated_async.Project() # Project | + + try: + # Update project + api_response = await api_instance.projects_id_put(id, body) + print("The response of ProjectApi->projects_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->projects_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of project | + **body** | [**Project**](Project.md)| | + +### Return type + +[**Project**](Project.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid project | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **projects_post** +> Project projects_post(body) + +Create project + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.project import Project +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.ProjectApi(api_client) + body = easybill_generated_async.Project() # Project | + + try: + # Create project + api_response = await api_instance.projects_post(body) + print("The response of ProjectApi->projects_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->projects_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Project**](Project.md)| | + +### Return type + +[**Project**](Project.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/Projects.md b/generated/async/docs/Projects.md new file mode 100644 index 0000000..f2236f7 --- /dev/null +++ b/generated/async/docs/Projects.md @@ -0,0 +1,33 @@ +# Projects + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Project]**](Project.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.projects import Projects + +# TODO update the JSON string below +json = "{}" +# create an instance of Projects from a JSON string +projects_instance = Projects.from_json(json) +# print the JSON string representation of the object +print(Projects.to_json()) + +# convert the object into a dict +projects_dict = projects_instance.to_dict() +# create an instance of Projects from a dict +projects_from_dict = Projects.from_dict(projects_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/SEPAPayment.md b/generated/async/docs/SEPAPayment.md new file mode 100644 index 0000000..1a1d4b4 --- /dev/null +++ b/generated/async/docs/SEPAPayment.md @@ -0,0 +1,52 @@ +# SEPAPayment + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **int** | Amount in cents (e.g. \"150\" = 1.50€) | +**created_at** | **datetime** | | [optional] [readonly] +**creditor_bic** | **str** | If type is DEBIT, this field is overwritten with the selected bank account data on export. | [optional] [default to 'null'] +**creditor_iban** | **str** | Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export. | [optional] +**creditor_name** | **str** | Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export. | [optional] +**debitor_bic** | **str** | If type is CREDIT, this field is overwritten with the selected bank account data on export. | [optional] [default to 'null'] +**debitor_iban** | **str** | Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export. | +**debitor_name** | **str** | Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export. | +**debitor_address_line_1** | **str** | Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA | [optional] +**debitor_address_line2** | **str** | string | [optional] +**debitor_country** | **str** | Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA | [optional] +**document_id** | **int** | | +**export_at** | **datetime** | If a date is set, this record is marked as exported | [optional] +**export_error** | **str** | | [optional] [readonly] +**id** | **int** | | [optional] [readonly] +**local_instrument** | **str** | CORE: SEPA Core Direct Debit<br/> COR1: SEPA-Basislastschrift COR1 (deprecated use CORE instead)<br/> B2B: SEPA Business to Business Direct Debit | +**mandate_date_of_signature** | **date** | | +**mandate_id** | **str** | | +**reference** | **str** | | +**remittance_information** | **str** | | [optional] [default to 'null'] +**requested_at** | **date** | Booking date | [optional] +**sequence_type** | **str** | FRST: Erstlastschrift<br/> RCUR: Folgelastschrift<br/> OOFF: Einmallastschrift<br/> FNAL: Letztmalige Lastschrift | +**updated_at** | **str** | | [optional] [readonly] +**type** | **str** | | [optional] [default to 'DEBIT'] + +## Example + +```python +from easybill_generated_async.models.sepa_payment import SEPAPayment + +# TODO update the JSON string below +json = "{}" +# create an instance of SEPAPayment from a JSON string +sepa_payment_instance = SEPAPayment.from_json(json) +# print the JSON string representation of the object +print(SEPAPayment.to_json()) + +# convert the object into a dict +sepa_payment_dict = sepa_payment_instance.to_dict() +# create an instance of SEPAPayment from a dict +sepa_payment_from_dict = SEPAPayment.from_dict(sepa_payment_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/SEPAPayments.md b/generated/async/docs/SEPAPayments.md new file mode 100644 index 0000000..be53c4d --- /dev/null +++ b/generated/async/docs/SEPAPayments.md @@ -0,0 +1,33 @@ +# SEPAPayments + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[SEPAPayment]**](SEPAPayment.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.sepa_payments import SEPAPayments + +# TODO update the JSON string below +json = "{}" +# create an instance of SEPAPayments from a JSON string +sepa_payments_instance = SEPAPayments.from_json(json) +# print the JSON string representation of the object +print(SEPAPayments.to_json()) + +# convert the object into a dict +sepa_payments_dict = sepa_payments_instance.to_dict() +# create an instance of SEPAPayments from a dict +sepa_payments_from_dict = SEPAPayments.from_dict(sepa_payments_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/SepaPaymentApi.md b/generated/async/docs/SepaPaymentApi.md new file mode 100644 index 0000000..ae022ec --- /dev/null +++ b/generated/async/docs/SepaPaymentApi.md @@ -0,0 +1,444 @@ +# easybill_generated_async.SepaPaymentApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**sepa_payments_get**](SepaPaymentApi.md#sepa_payments_get) | **GET** /sepa-payments | Fetch SEPA payments list +[**sepa_payments_id_delete**](SepaPaymentApi.md#sepa_payments_id_delete) | **DELETE** /sepa-payments/{id} | Delete SEPA payment +[**sepa_payments_id_get**](SepaPaymentApi.md#sepa_payments_id_get) | **GET** /sepa-payments/{id} | Fetch SEPA payment +[**sepa_payments_id_put**](SepaPaymentApi.md#sepa_payments_id_put) | **PUT** /sepa-payments/{id} | Update SEPA payment +[**sepa_payments_post**](SepaPaymentApi.md#sepa_payments_post) | **POST** /sepa-payments | Create SEPA payment + + +# **sepa_payments_get** +> SEPAPayments sepa_payments_get(limit=limit, page=page, document_id=document_id) + +Fetch SEPA payments list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.sepa_payments import SEPAPayments +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.SepaPaymentApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + document_id = 'document_id_example' # str | Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id. (optional) + + try: + # Fetch SEPA payments list + api_response = await api_instance.sepa_payments_get(limit=limit, page=page, document_id=document_id) + print("The response of SepaPaymentApi->sepa_payments_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SepaPaymentApi->sepa_payments_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **document_id** | **str**| Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id. | [optional] + +### Return type + +[**SEPAPayments**](SEPAPayments.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sepa_payments_id_delete** +> sepa_payments_id_delete(id) + +Delete SEPA payment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.SepaPaymentApi(api_client) + id = 56 # int | ID of SPEA payment + + try: + # Delete SEPA payment + await api_instance.sepa_payments_id_delete(id) + except Exception as e: + print("Exception when calling SepaPaymentApi->sepa_payments_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of SPEA payment | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sepa_payments_id_get** +> SEPAPayment sepa_payments_id_get(id) + +Fetch SEPA payment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.sepa_payment import SEPAPayment +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.SepaPaymentApi(api_client) + id = 56 # int | ID of SEPA payment + + try: + # Fetch SEPA payment + api_response = await api_instance.sepa_payments_id_get(id) + print("The response of SepaPaymentApi->sepa_payments_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SepaPaymentApi->sepa_payments_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of SEPA payment | + +### Return type + +[**SEPAPayment**](SEPAPayment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sepa_payments_id_put** +> SEPAPayment sepa_payments_id_put(id, body) + +Update SEPA payment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.sepa_payment import SEPAPayment +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.SepaPaymentApi(api_client) + id = 56 # int | ID of SEPA payment + body = easybill_generated_async.SEPAPayment() # SEPAPayment | + + try: + # Update SEPA payment + api_response = await api_instance.sepa_payments_id_put(id, body) + print("The response of SepaPaymentApi->sepa_payments_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SepaPaymentApi->sepa_payments_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of SEPA payment | + **body** | [**SEPAPayment**](SEPAPayment.md)| | + +### Return type + +[**SEPAPayment**](SEPAPayment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid SEPA payment | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sepa_payments_post** +> SEPAPayment sepa_payments_post(body) + +Create SEPA payment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.sepa_payment import SEPAPayment +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.SepaPaymentApi(api_client) + body = easybill_generated_async.SEPAPayment() # SEPAPayment | + + try: + # Create SEPA payment + api_response = await api_instance.sepa_payments_post(body) + print("The response of SepaPaymentApi->sepa_payments_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SepaPaymentApi->sepa_payments_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SEPAPayment**](SEPAPayment.md)| | + +### Return type + +[**SEPAPayment**](SEPAPayment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/SerialNumber.md b/generated/async/docs/SerialNumber.md new file mode 100644 index 0000000..a3d6d8a --- /dev/null +++ b/generated/async/docs/SerialNumber.md @@ -0,0 +1,35 @@ +# SerialNumber + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**serial_number** | **str** | | +**position_id** | **int** | | +**document_id** | **int** | | [optional] [readonly] +**document_position_id** | **int** | | [optional] [readonly] +**used_at** | **str** | | [optional] [readonly] +**created_at** | **str** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_async.models.serial_number import SerialNumber + +# TODO update the JSON string below +json = "{}" +# create an instance of SerialNumber from a JSON string +serial_number_instance = SerialNumber.from_json(json) +# print the JSON string representation of the object +print(SerialNumber.to_json()) + +# convert the object into a dict +serial_number_dict = serial_number_instance.to_dict() +# create an instance of SerialNumber from a dict +serial_number_from_dict = SerialNumber.from_dict(serial_number_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/SerialNumberApi.md b/generated/async/docs/SerialNumberApi.md new file mode 100644 index 0000000..77d8934 --- /dev/null +++ b/generated/async/docs/SerialNumberApi.md @@ -0,0 +1,361 @@ +# easybill_generated_async.SerialNumberApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**serial_numbers_get**](SerialNumberApi.md#serial_numbers_get) | **GET** /serial-numbers | Fetch a list of serial numbers for positions +[**serial_numbers_id_delete**](SerialNumberApi.md#serial_numbers_id_delete) | **DELETE** /serial-numbers/{id} | Delete a serial number for a position +[**serial_numbers_id_get**](SerialNumberApi.md#serial_numbers_id_get) | **GET** /serial-numbers/{id} | Fetch a serial number for a position +[**serial_numbers_post**](SerialNumberApi.md#serial_numbers_post) | **POST** /serial-numbers | Create s serial number for a position + + +# **serial_numbers_get** +> SerialNumbers serial_numbers_get(limit=limit, page=page, position_id=position_id, document_id=document_id, in_use=in_use) + +Fetch a list of serial numbers for positions + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.serial_numbers import SerialNumbers +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.SerialNumberApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + position_id = 'position_id_example' # str | Filter serial numbers by position id. (optional) + document_id = 'document_id_example' # str | Filter serial numbers by document id. (optional) + in_use = True # bool | Filter serial numbers by usage. (optional) + + try: + # Fetch a list of serial numbers for positions + api_response = await api_instance.serial_numbers_get(limit=limit, page=page, position_id=position_id, document_id=document_id, in_use=in_use) + print("The response of SerialNumberApi->serial_numbers_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SerialNumberApi->serial_numbers_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **position_id** | **str**| Filter serial numbers by position id. | [optional] + **document_id** | **str**| Filter serial numbers by document id. | [optional] + **in_use** | **bool**| Filter serial numbers by usage. | [optional] + +### Return type + +[**SerialNumbers**](SerialNumbers.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **serial_numbers_id_delete** +> serial_numbers_id_delete(id) + +Delete a serial number for a position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.SerialNumberApi(api_client) + id = 56 # int | ID of the serial number that needs to be deleted + + try: + # Delete a serial number for a position + await api_instance.serial_numbers_id_delete(id) + except Exception as e: + print("Exception when calling SerialNumberApi->serial_numbers_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the serial number that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**400** | Serial number in use. Operation failed. | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **serial_numbers_id_get** +> SerialNumber serial_numbers_id_get(id) + +Fetch a serial number for a position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.serial_number import SerialNumber +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.SerialNumberApi(api_client) + id = 56 # int | ID of the serial number that needs to be fetched + + try: + # Fetch a serial number for a position + api_response = await api_instance.serial_numbers_id_get(id) + print("The response of SerialNumberApi->serial_numbers_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SerialNumberApi->serial_numbers_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the serial number that needs to be fetched | + +### Return type + +[**SerialNumber**](SerialNumber.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **serial_numbers_post** +> SerialNumber serial_numbers_post(body=body) + +Create s serial number for a position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.serial_number import SerialNumber +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.SerialNumberApi(api_client) + body = easybill_generated_async.SerialNumber() # SerialNumber | (optional) + + try: + # Create s serial number for a position + api_response = await api_instance.serial_numbers_post(body=body) + print("The response of SerialNumberApi->serial_numbers_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SerialNumberApi->serial_numbers_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SerialNumber**](SerialNumber.md)| | [optional] + +### Return type + +[**SerialNumber**](SerialNumber.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid PositionID | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/SerialNumbers.md b/generated/async/docs/SerialNumbers.md new file mode 100644 index 0000000..5808356 --- /dev/null +++ b/generated/async/docs/SerialNumbers.md @@ -0,0 +1,33 @@ +# SerialNumbers + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[SerialNumber]**](SerialNumber.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.serial_numbers import SerialNumbers + +# TODO update the JSON string below +json = "{}" +# create an instance of SerialNumbers from a JSON string +serial_numbers_instance = SerialNumbers.from_json(json) +# print the JSON string representation of the object +print(SerialNumbers.to_json()) + +# convert the object into a dict +serial_numbers_dict = serial_numbers_instance.to_dict() +# create an instance of SerialNumbers from a dict +serial_numbers_from_dict = SerialNumbers.from_dict(serial_numbers_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/ServiceDate.md b/generated/async/docs/ServiceDate.md new file mode 100644 index 0000000..90115f2 --- /dev/null +++ b/generated/async/docs/ServiceDate.md @@ -0,0 +1,34 @@ +# ServiceDate + +This object is only available in document type INVOICE or CREDIT. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | With DEFAULT no other fields are required and this message will be printed: 'Invoice date coincides with the time of supply'.<br/> For SERVICE or DELIVERY exactly one of the following fields must be set: date, date_from and date_to or text. | [optional] +**var_date** | **date** | | [optional] +**date_from** | **date** | | [optional] +**date_to** | **date** | | [optional] +**text** | **str** | | [optional] [default to 'null'] + +## Example + +```python +from easybill_generated_async.models.service_date import ServiceDate + +# TODO update the JSON string below +json = "{}" +# create an instance of ServiceDate from a JSON string +service_date_instance = ServiceDate.from_json(json) +# print the JSON string representation of the object +print(ServiceDate.to_json()) + +# convert the object into a dict +service_date_dict = service_date_instance.to_dict() +# create an instance of ServiceDate from a dict +service_date_from_dict = ServiceDate.from_dict(service_date_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/Stock.md b/generated/async/docs/Stock.md new file mode 100644 index 0000000..f58d4f2 --- /dev/null +++ b/generated/async/docs/Stock.md @@ -0,0 +1,37 @@ +# Stock + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**note** | **str** | | [optional] +**stock_count** | **int** | | +**position_id** | **int** | | +**document_id** | **int** | | [optional] [readonly] +**document_position_id** | **int** | | [optional] [readonly] +**stored_at** | **str** | | [optional] +**created_at** | **str** | | [optional] [readonly] +**updated_at** | **str** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_async.models.stock import Stock + +# TODO update the JSON string below +json = "{}" +# create an instance of Stock from a JSON string +stock_instance = Stock.from_json(json) +# print the JSON string representation of the object +print(Stock.to_json()) + +# convert the object into a dict +stock_dict = stock_instance.to_dict() +# create an instance of Stock from a dict +stock_from_dict = Stock.from_dict(stock_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/StockApi.md b/generated/async/docs/StockApi.md new file mode 100644 index 0000000..7d43db2 --- /dev/null +++ b/generated/async/docs/StockApi.md @@ -0,0 +1,274 @@ +# easybill_generated_async.StockApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**stocks_get**](StockApi.md#stocks_get) | **GET** /stocks | Fetch a list of stock entries for positions +[**stocks_id_get**](StockApi.md#stocks_id_get) | **GET** /stocks/{id} | Fetch an stock entry for a position +[**stocks_post**](StockApi.md#stocks_post) | **POST** /stocks | Create a stock entry for a position + + +# **stocks_get** +> Stocks stocks_get(limit=limit, page=page, position_id=position_id, document_id=document_id) + +Fetch a list of stock entries for positions + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.stocks import Stocks +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.StockApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + position_id = 'position_id_example' # str | Filter stock entries by position id. (optional) + document_id = 'document_id_example' # str | Filter stock entries by document id. (optional) + + try: + # Fetch a list of stock entries for positions + api_response = await api_instance.stocks_get(limit=limit, page=page, position_id=position_id, document_id=document_id) + print("The response of StockApi->stocks_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling StockApi->stocks_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **position_id** | **str**| Filter stock entries by position id. | [optional] + **document_id** | **str**| Filter stock entries by document id. | [optional] + +### Return type + +[**Stocks**](Stocks.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **stocks_id_get** +> Stock stocks_id_get(id) + +Fetch an stock entry for a position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.stock import Stock +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.StockApi(api_client) + id = 56 # int | ID of the stock entry that needs to be fetched + + try: + # Fetch an stock entry for a position + api_response = await api_instance.stocks_id_get(id) + print("The response of StockApi->stocks_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling StockApi->stocks_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the stock entry that needs to be fetched | + +### Return type + +[**Stock**](Stock.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **stocks_post** +> Stock stocks_post(body) + +Create a stock entry for a position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.stock import Stock +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.StockApi(api_client) + body = easybill_generated_async.Stock() # Stock | + + try: + # Create a stock entry for a position + api_response = await api_instance.stocks_post(body) + print("The response of StockApi->stocks_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling StockApi->stocks_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Stock**](Stock.md)| | + +### Return type + +[**Stock**](Stock.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**400** | Invalid position_id or stock_count | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/Stocks.md b/generated/async/docs/Stocks.md new file mode 100644 index 0000000..4e24638 --- /dev/null +++ b/generated/async/docs/Stocks.md @@ -0,0 +1,33 @@ +# Stocks + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Stock]**](Stock.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.stocks import Stocks + +# TODO update the JSON string below +json = "{}" +# create an instance of Stocks from a JSON string +stocks_instance = Stocks.from_json(json) +# print the JSON string representation of the object +print(Stocks.to_json()) + +# convert the object into a dict +stocks_dict = stocks_instance.to_dict() +# create an instance of Stocks from a dict +stocks_from_dict = Stocks.from_dict(stocks_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/Task.md b/generated/async/docs/Task.md new file mode 100644 index 0000000..36edba8 --- /dev/null +++ b/generated/async/docs/Task.md @@ -0,0 +1,45 @@ +# Task + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | | [optional] [default to null] +**category_custom** | **str** | The name of your custom category. Can only have a value if \"category\" is \"CUSTOM\". | [optional] [default to 'null'] +**created_at** | **datetime** | | [optional] [readonly] +**customer_id** | **int** | | [optional] +**description** | **str** | | [optional] [default to 'null'] +**document_id** | **int** | | [optional] +**end_at** | **datetime** | The deadline | [optional] +**finish_at** | **datetime** | The time when the task was marked as done | [optional] [readonly] +**id** | **int** | | [optional] [readonly] +**login_id** | **int** | When omitted or null, the currently active login is used | [optional] +**name** | **str** | | +**position_id** | **int** | | [optional] +**priority** | **str** | | [optional] [default to 'NORMAL'] +**project_id** | **int** | | [optional] +**start_at** | **datetime** | | [optional] +**status** | **str** | | +**status_percent** | **int** | | [optional] + +## Example + +```python +from easybill_generated_async.models.task import Task + +# TODO update the JSON string below +json = "{}" +# create an instance of Task from a JSON string +task_instance = Task.from_json(json) +# print the JSON string representation of the object +print(Task.to_json()) + +# convert the object into a dict +task_dict = task_instance.to_dict() +# create an instance of Task from a dict +task_from_dict = Task.from_dict(task_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/TaskApi.md b/generated/async/docs/TaskApi.md new file mode 100644 index 0000000..bac8aaa --- /dev/null +++ b/generated/async/docs/TaskApi.md @@ -0,0 +1,442 @@ +# easybill_generated_async.TaskApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**tasks_get**](TaskApi.md#tasks_get) | **GET** /tasks | Fetch tasks list +[**tasks_id_delete**](TaskApi.md#tasks_id_delete) | **DELETE** /tasks/{id} | Delete task +[**tasks_id_get**](TaskApi.md#tasks_id_get) | **GET** /tasks/{id} | Fetch task +[**tasks_id_put**](TaskApi.md#tasks_id_put) | **PUT** /tasks/{id} | Update task +[**tasks_post**](TaskApi.md#tasks_post) | **POST** /tasks | Create task + + +# **tasks_get** +> Tasks tasks_get(limit=limit, page=page) + +Fetch tasks list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.tasks import Tasks +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TaskApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch tasks list + api_response = await api_instance.tasks_get(limit=limit, page=page) + print("The response of TaskApi->tasks_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TaskApi->tasks_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**Tasks**](Tasks.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **tasks_id_delete** +> tasks_id_delete(id) + +Delete task + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TaskApi(api_client) + id = 56 # int | ID of task + + try: + # Delete task + await api_instance.tasks_id_delete(id) + except Exception as e: + print("Exception when calling TaskApi->tasks_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of task | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **tasks_id_get** +> Task tasks_id_get(id) + +Fetch task + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.task import Task +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TaskApi(api_client) + id = 56 # int | ID of task + + try: + # Fetch task + api_response = await api_instance.tasks_id_get(id) + print("The response of TaskApi->tasks_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TaskApi->tasks_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of task | + +### Return type + +[**Task**](Task.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **tasks_id_put** +> Task tasks_id_put(id, body) + +Update task + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.task import Task +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TaskApi(api_client) + id = 56 # int | ID of task + body = easybill_generated_async.Task() # Task | + + try: + # Update task + api_response = await api_instance.tasks_id_put(id, body) + print("The response of TaskApi->tasks_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TaskApi->tasks_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of task | + **body** | [**Task**](Task.md)| | + +### Return type + +[**Task**](Task.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid task | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **tasks_post** +> Task tasks_post(body) + +Create task + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.task import Task +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TaskApi(api_client) + body = easybill_generated_async.Task() # Task | + + try: + # Create task + api_response = await api_instance.tasks_post(body) + print("The response of TaskApi->tasks_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TaskApi->tasks_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Task**](Task.md)| | + +### Return type + +[**Task**](Task.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/Tasks.md b/generated/async/docs/Tasks.md new file mode 100644 index 0000000..99681b7 --- /dev/null +++ b/generated/async/docs/Tasks.md @@ -0,0 +1,33 @@ +# Tasks + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Task]**](Task.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.tasks import Tasks + +# TODO update the JSON string below +json = "{}" +# create an instance of Tasks from a JSON string +tasks_instance = Tasks.from_json(json) +# print the JSON string representation of the object +print(Tasks.to_json()) + +# convert the object into a dict +tasks_dict = tasks_instance.to_dict() +# create an instance of Tasks from a dict +tasks_from_dict = Tasks.from_dict(tasks_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/TextTemplate.md b/generated/async/docs/TextTemplate.md new file mode 100644 index 0000000..3e87668 --- /dev/null +++ b/generated/async/docs/TextTemplate.md @@ -0,0 +1,32 @@ +# TextTemplate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_modify** | **bool** | Deprecated, field is always true. | [optional] [readonly] +**id** | **int** | | [optional] [readonly] +**text** | **str** | | +**title** | **str** | | + +## Example + +```python +from easybill_generated_async.models.text_template import TextTemplate + +# TODO update the JSON string below +json = "{}" +# create an instance of TextTemplate from a JSON string +text_template_instance = TextTemplate.from_json(json) +# print the JSON string representation of the object +print(TextTemplate.to_json()) + +# convert the object into a dict +text_template_dict = text_template_instance.to_dict() +# create an instance of TextTemplate from a dict +text_template_from_dict = TextTemplate.from_dict(text_template_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/TextTemplateApi.md b/generated/async/docs/TextTemplateApi.md new file mode 100644 index 0000000..ec81024 --- /dev/null +++ b/generated/async/docs/TextTemplateApi.md @@ -0,0 +1,442 @@ +# easybill_generated_async.TextTemplateApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**text_templates_get**](TextTemplateApi.md#text_templates_get) | **GET** /text-templates | Fetch text templates list +[**text_templates_id_delete**](TextTemplateApi.md#text_templates_id_delete) | **DELETE** /text-templates/{id} | Delete text template +[**text_templates_id_get**](TextTemplateApi.md#text_templates_id_get) | **GET** /text-templates/{id} | Fetch text template +[**text_templates_id_put**](TextTemplateApi.md#text_templates_id_put) | **PUT** /text-templates/{id} | Update text template +[**text_templates_post**](TextTemplateApi.md#text_templates_post) | **POST** /text-templates | Create text template + + +# **text_templates_get** +> TextTemplates text_templates_get(limit=limit, page=page) + +Fetch text templates list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.text_templates import TextTemplates +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TextTemplateApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch text templates list + api_response = await api_instance.text_templates_get(limit=limit, page=page) + print("The response of TextTemplateApi->text_templates_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TextTemplateApi->text_templates_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**TextTemplates**](TextTemplates.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **text_templates_id_delete** +> text_templates_id_delete(id) + +Delete text template + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TextTemplateApi(api_client) + id = 56 # int | ID of text template + + try: + # Delete text template + await api_instance.text_templates_id_delete(id) + except Exception as e: + print("Exception when calling TextTemplateApi->text_templates_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of text template | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **text_templates_id_get** +> TextTemplate text_templates_id_get(id) + +Fetch text template + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.text_template import TextTemplate +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TextTemplateApi(api_client) + id = 56 # int | ID of text template + + try: + # Fetch text template + api_response = await api_instance.text_templates_id_get(id) + print("The response of TextTemplateApi->text_templates_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TextTemplateApi->text_templates_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of text template | + +### Return type + +[**TextTemplate**](TextTemplate.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **text_templates_id_put** +> TextTemplate text_templates_id_put(id, body) + +Update text template + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.text_template import TextTemplate +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TextTemplateApi(api_client) + id = 56 # int | ID of text template + body = easybill_generated_async.TextTemplate() # TextTemplate | + + try: + # Update text template + api_response = await api_instance.text_templates_id_put(id, body) + print("The response of TextTemplateApi->text_templates_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TextTemplateApi->text_templates_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of text template | + **body** | [**TextTemplate**](TextTemplate.md)| | + +### Return type + +[**TextTemplate**](TextTemplate.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid text template | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **text_templates_post** +> TextTemplate text_templates_post(body) + +Create text template + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.text_template import TextTemplate +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TextTemplateApi(api_client) + body = easybill_generated_async.TextTemplate() # TextTemplate | + + try: + # Create text template + api_response = await api_instance.text_templates_post(body) + print("The response of TextTemplateApi->text_templates_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TextTemplateApi->text_templates_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**TextTemplate**](TextTemplate.md)| | + +### Return type + +[**TextTemplate**](TextTemplate.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/TextTemplates.md b/generated/async/docs/TextTemplates.md new file mode 100644 index 0000000..1dd1988 --- /dev/null +++ b/generated/async/docs/TextTemplates.md @@ -0,0 +1,33 @@ +# TextTemplates + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[TextTemplate]**](TextTemplate.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.text_templates import TextTemplates + +# TODO update the JSON string below +json = "{}" +# create an instance of TextTemplates from a JSON string +text_templates_instance = TextTemplates.from_json(json) +# print the JSON string representation of the object +print(TextTemplates.to_json()) + +# convert the object into a dict +text_templates_dict = text_templates_instance.to_dict() +# create an instance of TextTemplates from a dict +text_templates_from_dict = TextTemplates.from_dict(text_templates_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/TimeTracking.md b/generated/async/docs/TimeTracking.md new file mode 100644 index 0000000..2caa16e --- /dev/null +++ b/generated/async/docs/TimeTracking.md @@ -0,0 +1,41 @@ +# TimeTracking + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cleared_at** | **datetime** | | [optional] +**created_at** | **datetime** | | [optional] [readonly] +**date_from_at** | **datetime** | | [optional] +**date_thru_at** | **datetime** | | [optional] +**description** | **str** | | +**hourly_rate** | **float** | Hourly rate in cents (e.g. \"150\" = 1.50€) | [optional] [default to 0.0] +**id** | **int** | | [optional] [readonly] +**note** | **str** | | [optional] [default to 'null'] +**number** | **str** | Can be chosen freely | [optional] +**position_id** | **int** | | [optional] +**project_id** | **int** | | [optional] +**login_id** | **int** | If omitted or null, the currently active login is used. | [optional] +**timer_value** | **int** | Tracked time in minutes | [optional] + +## Example + +```python +from easybill_generated_async.models.time_tracking import TimeTracking + +# TODO update the JSON string below +json = "{}" +# create an instance of TimeTracking from a JSON string +time_tracking_instance = TimeTracking.from_json(json) +# print the JSON string representation of the object +print(TimeTracking.to_json()) + +# convert the object into a dict +time_tracking_dict = time_tracking_instance.to_dict() +# create an instance of TimeTracking from a dict +time_tracking_from_dict = TimeTracking.from_dict(time_tracking_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/TimeTrackingApi.md b/generated/async/docs/TimeTrackingApi.md new file mode 100644 index 0000000..d2df3a0 --- /dev/null +++ b/generated/async/docs/TimeTrackingApi.md @@ -0,0 +1,450 @@ +# easybill_generated_async.TimeTrackingApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**time_trackings_get**](TimeTrackingApi.md#time_trackings_get) | **GET** /time-trackings | Fetch time trackings list +[**time_trackings_id_delete**](TimeTrackingApi.md#time_trackings_id_delete) | **DELETE** /time-trackings/{id} | Delete time tracking +[**time_trackings_id_get**](TimeTrackingApi.md#time_trackings_id_get) | **GET** /time-trackings/{id} | Fetch time tracking +[**time_trackings_id_put**](TimeTrackingApi.md#time_trackings_id_put) | **PUT** /time-trackings/{id} | Update time tracking +[**time_trackings_post**](TimeTrackingApi.md#time_trackings_post) | **POST** /time-trackings | Create time tracking + + +# **time_trackings_get** +> TimeTrackings time_trackings_get(limit=limit, page=page, login_id=login_id, project_id=project_id, date_from_at=date_from_at, date_thru_at=date_thru_at) + +Fetch time trackings list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.time_trackings import TimeTrackings +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TimeTrackingApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + login_id = 'login_id_example' # str | Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id. (optional) + project_id = 'project_id_example' # str | Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id. (optional) + date_from_at = 'date_from_at_example' # str | Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. (optional) + date_thru_at = 'date_thru_at_example' # str | Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. (optional) + + try: + # Fetch time trackings list + api_response = await api_instance.time_trackings_get(limit=limit, page=page, login_id=login_id, project_id=project_id, date_from_at=date_from_at, date_thru_at=date_thru_at) + print("The response of TimeTrackingApi->time_trackings_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TimeTrackingApi->time_trackings_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **login_id** | **str**| Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id. | [optional] + **project_id** | **str**| Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id. | [optional] + **date_from_at** | **str**| Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. | [optional] + **date_thru_at** | **str**| Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. | [optional] + +### Return type + +[**TimeTrackings**](TimeTrackings.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **time_trackings_id_delete** +> time_trackings_id_delete(id) + +Delete time tracking + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TimeTrackingApi(api_client) + id = 56 # int | ID of time tracking + + try: + # Delete time tracking + await api_instance.time_trackings_id_delete(id) + except Exception as e: + print("Exception when calling TimeTrackingApi->time_trackings_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of time tracking | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **time_trackings_id_get** +> TimeTracking time_trackings_id_get(id) + +Fetch time tracking + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.time_tracking import TimeTracking +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TimeTrackingApi(api_client) + id = 56 # int | ID of time tracking + + try: + # Fetch time tracking + api_response = await api_instance.time_trackings_id_get(id) + print("The response of TimeTrackingApi->time_trackings_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TimeTrackingApi->time_trackings_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of time tracking | + +### Return type + +[**TimeTracking**](TimeTracking.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **time_trackings_id_put** +> TimeTracking time_trackings_id_put(id, body) + +Update time tracking + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.time_tracking import TimeTracking +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TimeTrackingApi(api_client) + id = 56 # int | ID of time tracking + body = easybill_generated_async.TimeTracking() # TimeTracking | + + try: + # Update time tracking + api_response = await api_instance.time_trackings_id_put(id, body) + print("The response of TimeTrackingApi->time_trackings_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TimeTrackingApi->time_trackings_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of time tracking | + **body** | [**TimeTracking**](TimeTracking.md)| | + +### Return type + +[**TimeTracking**](TimeTracking.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid time tracking | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **time_trackings_post** +> TimeTracking time_trackings_post(body) + +Create time tracking + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.time_tracking import TimeTracking +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.TimeTrackingApi(api_client) + body = easybill_generated_async.TimeTracking() # TimeTracking | + + try: + # Create time tracking + api_response = await api_instance.time_trackings_post(body) + print("The response of TimeTrackingApi->time_trackings_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TimeTrackingApi->time_trackings_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**TimeTracking**](TimeTracking.md)| | + +### Return type + +[**TimeTracking**](TimeTracking.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/docs/TimeTrackings.md b/generated/async/docs/TimeTrackings.md new file mode 100644 index 0000000..88df795 --- /dev/null +++ b/generated/async/docs/TimeTrackings.md @@ -0,0 +1,33 @@ +# TimeTrackings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[TimeTracking]**](TimeTracking.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.time_trackings import TimeTrackings + +# TODO update the JSON string below +json = "{}" +# create an instance of TimeTrackings from a JSON string +time_trackings_instance = TimeTrackings.from_json(json) +# print the JSON string representation of the object +print(TimeTrackings.to_json()) + +# convert the object into a dict +time_trackings_dict = time_trackings_instance.to_dict() +# create an instance of TimeTrackings from a dict +time_trackings_from_dict = TimeTrackings.from_dict(time_trackings_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/WebHook.md b/generated/async/docs/WebHook.md new file mode 100644 index 0000000..d67c75d --- /dev/null +++ b/generated/async/docs/WebHook.md @@ -0,0 +1,36 @@ +# WebHook + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content_type** | **str** | | +**description** | **str** | | +**events** | **List[str]** | | +**id** | **int** | | [optional] [readonly] +**is_active** | **bool** | | [optional] [default to False] +**last_response** | [**WebHookLastResponse**](WebHookLastResponse.md) | | [optional] +**secret** | **str** | | +**url** | **str** | | + +## Example + +```python +from easybill_generated_async.models.web_hook import WebHook + +# TODO update the JSON string below +json = "{}" +# create an instance of WebHook from a JSON string +web_hook_instance = WebHook.from_json(json) +# print the JSON string representation of the object +print(WebHook.to_json()) + +# convert the object into a dict +web_hook_dict = web_hook_instance.to_dict() +# create an instance of WebHook from a dict +web_hook_from_dict = WebHook.from_dict(web_hook_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/WebHookLastResponse.md b/generated/async/docs/WebHookLastResponse.md new file mode 100644 index 0000000..c45f127 --- /dev/null +++ b/generated/async/docs/WebHookLastResponse.md @@ -0,0 +1,31 @@ +# WebHookLastResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | | [optional] [readonly] +**code** | **int** | | [optional] [readonly] +**response** | **str** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_async.models.web_hook_last_response import WebHookLastResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of WebHookLastResponse from a JSON string +web_hook_last_response_instance = WebHookLastResponse.from_json(json) +# print the JSON string representation of the object +print(WebHookLastResponse.to_json()) + +# convert the object into a dict +web_hook_last_response_dict = web_hook_last_response_instance.to_dict() +# create an instance of WebHookLastResponse from a dict +web_hook_last_response_from_dict = WebHookLastResponse.from_dict(web_hook_last_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/WebHooks.md b/generated/async/docs/WebHooks.md new file mode 100644 index 0000000..868fb6a --- /dev/null +++ b/generated/async/docs/WebHooks.md @@ -0,0 +1,33 @@ +# WebHooks + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[WebHook]**](WebHook.md) | | [optional] + +## Example + +```python +from easybill_generated_async.models.web_hooks import WebHooks + +# TODO update the JSON string below +json = "{}" +# create an instance of WebHooks from a JSON string +web_hooks_instance = WebHooks.from_json(json) +# print the JSON string representation of the object +print(WebHooks.to_json()) + +# convert the object into a dict +web_hooks_dict = web_hooks_instance.to_dict() +# create an instance of WebHooks from a dict +web_hooks_from_dict = WebHooks.from_dict(web_hooks_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/async/docs/WebhookApi.md b/generated/async/docs/WebhookApi.md new file mode 100644 index 0000000..e6eedf3 --- /dev/null +++ b/generated/async/docs/WebhookApi.md @@ -0,0 +1,442 @@ +# easybill_generated_async.WebhookApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**webhooks_get**](WebhookApi.md#webhooks_get) | **GET** /webhooks | Fetch WebHooks list +[**webhooks_id_delete**](WebhookApi.md#webhooks_id_delete) | **DELETE** /webhooks/{id} | Delete WebHook +[**webhooks_id_get**](WebhookApi.md#webhooks_id_get) | **GET** /webhooks/{id} | Fetch WebHook +[**webhooks_id_put**](WebhookApi.md#webhooks_id_put) | **PUT** /webhooks/{id} | Update WebHook +[**webhooks_post**](WebhookApi.md#webhooks_post) | **POST** /webhooks | Create WebHook + + +# **webhooks_get** +> WebHooks webhooks_get(limit=limit, page=page) + +Fetch WebHooks list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.web_hooks import WebHooks +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.WebhookApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch WebHooks list + api_response = await api_instance.webhooks_get(limit=limit, page=page) + print("The response of WebhookApi->webhooks_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebhookApi->webhooks_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**WebHooks**](WebHooks.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **webhooks_id_delete** +> webhooks_id_delete(id) + +Delete WebHook + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.WebhookApi(api_client) + id = 56 # int | ID of WebHook + + try: + # Delete WebHook + await api_instance.webhooks_id_delete(id) + except Exception as e: + print("Exception when calling WebhookApi->webhooks_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of WebHook | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **webhooks_id_get** +> WebHook webhooks_id_get(id) + +Fetch WebHook + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.web_hook import WebHook +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.WebhookApi(api_client) + id = 56 # int | ID of WebHook + + try: + # Fetch WebHook + api_response = await api_instance.webhooks_id_get(id) + print("The response of WebhookApi->webhooks_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebhookApi->webhooks_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of WebHook | + +### Return type + +[**WebHook**](WebHook.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **webhooks_id_put** +> WebHook webhooks_id_put(id, body) + +Update WebHook + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.web_hook import WebHook +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.WebhookApi(api_client) + id = 56 # int | ID of WebHook + body = easybill_generated_async.WebHook() # WebHook | + + try: + # Update WebHook + api_response = await api_instance.webhooks_id_put(id, body) + print("The response of WebhookApi->webhooks_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebhookApi->webhooks_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of WebHook | + **body** | [**WebHook**](WebHook.md)| | + +### Return type + +[**WebHook**](WebHook.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **webhooks_post** +> WebHook webhooks_post(body) + +Create WebHook + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_async +from easybill_generated_async.models.web_hook import WebHook +from easybill_generated_async.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_async.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_async.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_async.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_async.WebhookApi(api_client) + body = easybill_generated_async.WebHook() # WebHook | + + try: + # Create WebHook + api_response = await api_instance.webhooks_post(body) + print("The response of WebhookApi->webhooks_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebhookApi->webhooks_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**WebHook**](WebHook.md)| | + +### Return type + +[**WebHook**](WebHook.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/async/easybill_generated_async/__init__.py b/generated/async/easybill_generated_async/__init__.py new file mode 100644 index 0000000..03cc1f9 --- /dev/null +++ b/generated/async/easybill_generated_async/__init__.py @@ -0,0 +1,208 @@ +# coding: utf-8 + +# flake8: noqa + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "1.0.0" + +# Define package exports +__all__ = [ + "AttachmentApi", + "ContactApi", + "CustomerApi", + "CustomerGroupApi", + "DiscountApi", + "DocumentApi", + "DocumentPaymentApi", + "DocumentVersionApi", + "LoginsApi", + "PdfTemplatesApi", + "PositionApi", + "PositionGroupApi", + "PostBoxApi", + "ProjectApi", + "SepaPaymentApi", + "SerialNumberApi", + "StockApi", + "TaskApi", + "TextTemplateApi", + "TimeTrackingApi", + "WebhookApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "AdvancedDataField", + "Attachment", + "Attachments", + "Contact", + "Contacts", + "Customer", + "CustomerGroup", + "CustomerGroups", + "CustomerSnapshot", + "Customers", + "Discount", + "DiscountPosition", + "DiscountPositionGroup", + "DiscountPositionGroups", + "DiscountPositions", + "Document", + "DocumentAddress", + "DocumentPayment", + "DocumentPayments", + "DocumentPosition", + "DocumentRecurring", + "DocumentVersion", + "DocumentVersionItem", + "DocumentVersions", + "Documents", + "FileFormatConfig", + "List", + "Login", + "LoginSecurity", + "Logins", + "PDFTemplate", + "PDFTemplateSettings", + "PDFTemplateSettingsEmail", + "PDFTemplates", + "Position", + "PositionExportIdentifierExtended", + "PositionGroup", + "PositionGroups", + "Positions", + "PostBox", + "PostBoxRequest", + "PostBoxes", + "Project", + "Projects", + "SEPAPayment", + "SEPAPayments", + "SerialNumber", + "SerialNumbers", + "ServiceDate", + "Stock", + "Stocks", + "Task", + "Tasks", + "TextTemplate", + "TextTemplates", + "TimeTracking", + "TimeTrackings", + "WebHook", + "WebHookLastResponse", + "WebHooks", +] + +# import apis into sdk package +from easybill_generated_async.api.attachment_api import AttachmentApi as AttachmentApi +from easybill_generated_async.api.contact_api import ContactApi as ContactApi +from easybill_generated_async.api.customer_api import CustomerApi as CustomerApi +from easybill_generated_async.api.customer_group_api import CustomerGroupApi as CustomerGroupApi +from easybill_generated_async.api.discount_api import DiscountApi as DiscountApi +from easybill_generated_async.api.document_api import DocumentApi as DocumentApi +from easybill_generated_async.api.document_payment_api import DocumentPaymentApi as DocumentPaymentApi +from easybill_generated_async.api.document_version_api import DocumentVersionApi as DocumentVersionApi +from easybill_generated_async.api.logins_api import LoginsApi as LoginsApi +from easybill_generated_async.api.pdf_templates_api import PdfTemplatesApi as PdfTemplatesApi +from easybill_generated_async.api.position_api import PositionApi as PositionApi +from easybill_generated_async.api.position_group_api import PositionGroupApi as PositionGroupApi +from easybill_generated_async.api.post_box_api import PostBoxApi as PostBoxApi +from easybill_generated_async.api.project_api import ProjectApi as ProjectApi +from easybill_generated_async.api.sepa_payment_api import SepaPaymentApi as SepaPaymentApi +from easybill_generated_async.api.serial_number_api import SerialNumberApi as SerialNumberApi +from easybill_generated_async.api.stock_api import StockApi as StockApi +from easybill_generated_async.api.task_api import TaskApi as TaskApi +from easybill_generated_async.api.text_template_api import TextTemplateApi as TextTemplateApi +from easybill_generated_async.api.time_tracking_api import TimeTrackingApi as TimeTrackingApi +from easybill_generated_async.api.webhook_api import WebhookApi as WebhookApi + +# import ApiClient +from easybill_generated_async.api_response import ApiResponse as ApiResponse +from easybill_generated_async.api_client import ApiClient as ApiClient +from easybill_generated_async.configuration import Configuration as Configuration +from easybill_generated_async.exceptions import OpenApiException as OpenApiException +from easybill_generated_async.exceptions import ApiTypeError as ApiTypeError +from easybill_generated_async.exceptions import ApiValueError as ApiValueError +from easybill_generated_async.exceptions import ApiKeyError as ApiKeyError +from easybill_generated_async.exceptions import ApiAttributeError as ApiAttributeError +from easybill_generated_async.exceptions import ApiException as ApiException + +# import models into sdk package +from easybill_generated_async.models.advanced_data_field import AdvancedDataField as AdvancedDataField +from easybill_generated_async.models.attachment import Attachment as Attachment +from easybill_generated_async.models.attachments import Attachments as Attachments +from easybill_generated_async.models.contact import Contact as Contact +from easybill_generated_async.models.contacts import Contacts as Contacts +from easybill_generated_async.models.customer import Customer as Customer +from easybill_generated_async.models.customer_group import CustomerGroup as CustomerGroup +from easybill_generated_async.models.customer_groups import CustomerGroups as CustomerGroups +from easybill_generated_async.models.customer_snapshot import CustomerSnapshot as CustomerSnapshot +from easybill_generated_async.models.customers import Customers as Customers +from easybill_generated_async.models.discount import Discount as Discount +from easybill_generated_async.models.discount_position import DiscountPosition as DiscountPosition +from easybill_generated_async.models.discount_position_group import DiscountPositionGroup as DiscountPositionGroup +from easybill_generated_async.models.discount_position_groups import DiscountPositionGroups as DiscountPositionGroups +from easybill_generated_async.models.discount_positions import DiscountPositions as DiscountPositions +from easybill_generated_async.models.document import Document as Document +from easybill_generated_async.models.document_address import DocumentAddress as DocumentAddress +from easybill_generated_async.models.document_payment import DocumentPayment as DocumentPayment +from easybill_generated_async.models.document_payments import DocumentPayments as DocumentPayments +from easybill_generated_async.models.document_position import DocumentPosition as DocumentPosition +from easybill_generated_async.models.document_recurring import DocumentRecurring as DocumentRecurring +from easybill_generated_async.models.document_version import DocumentVersion as DocumentVersion +from easybill_generated_async.models.document_version_item import DocumentVersionItem as DocumentVersionItem +from easybill_generated_async.models.document_versions import DocumentVersions as DocumentVersions +from easybill_generated_async.models.documents import Documents as Documents +from easybill_generated_async.models.file_format_config import FileFormatConfig as FileFormatConfig +from easybill_generated_async.models.list import List as List +from easybill_generated_async.models.login import Login as Login +from easybill_generated_async.models.login_security import LoginSecurity as LoginSecurity +from easybill_generated_async.models.logins import Logins as Logins +from easybill_generated_async.models.pdf_template import PDFTemplate as PDFTemplate +from easybill_generated_async.models.pdf_template_settings import PDFTemplateSettings as PDFTemplateSettings +from easybill_generated_async.models.pdf_template_settings_email import PDFTemplateSettingsEmail as PDFTemplateSettingsEmail +from easybill_generated_async.models.pdf_templates import PDFTemplates as PDFTemplates +from easybill_generated_async.models.position import Position as Position +from easybill_generated_async.models.position_export_identifier_extended import PositionExportIdentifierExtended as PositionExportIdentifierExtended +from easybill_generated_async.models.position_group import PositionGroup as PositionGroup +from easybill_generated_async.models.position_groups import PositionGroups as PositionGroups +from easybill_generated_async.models.positions import Positions as Positions +from easybill_generated_async.models.post_box import PostBox as PostBox +from easybill_generated_async.models.post_box_request import PostBoxRequest as PostBoxRequest +from easybill_generated_async.models.post_boxes import PostBoxes as PostBoxes +from easybill_generated_async.models.project import Project as Project +from easybill_generated_async.models.projects import Projects as Projects +from easybill_generated_async.models.sepa_payment import SEPAPayment as SEPAPayment +from easybill_generated_async.models.sepa_payments import SEPAPayments as SEPAPayments +from easybill_generated_async.models.serial_number import SerialNumber as SerialNumber +from easybill_generated_async.models.serial_numbers import SerialNumbers as SerialNumbers +from easybill_generated_async.models.service_date import ServiceDate as ServiceDate +from easybill_generated_async.models.stock import Stock as Stock +from easybill_generated_async.models.stocks import Stocks as Stocks +from easybill_generated_async.models.task import Task as Task +from easybill_generated_async.models.tasks import Tasks as Tasks +from easybill_generated_async.models.text_template import TextTemplate as TextTemplate +from easybill_generated_async.models.text_templates import TextTemplates as TextTemplates +from easybill_generated_async.models.time_tracking import TimeTracking as TimeTracking +from easybill_generated_async.models.time_trackings import TimeTrackings as TimeTrackings +from easybill_generated_async.models.web_hook import WebHook as WebHook +from easybill_generated_async.models.web_hook_last_response import WebHookLastResponse as WebHookLastResponse +from easybill_generated_async.models.web_hooks import WebHooks as WebHooks + diff --git a/generated/async/easybill_generated_async/api/__init__.py b/generated/async/easybill_generated_async/api/__init__.py new file mode 100644 index 0000000..93444ba --- /dev/null +++ b/generated/async/easybill_generated_async/api/__init__.py @@ -0,0 +1,25 @@ +# flake8: noqa + +# import apis into api package +from easybill_generated_async.api.attachment_api import AttachmentApi +from easybill_generated_async.api.contact_api import ContactApi +from easybill_generated_async.api.customer_api import CustomerApi +from easybill_generated_async.api.customer_group_api import CustomerGroupApi +from easybill_generated_async.api.discount_api import DiscountApi +from easybill_generated_async.api.document_api import DocumentApi +from easybill_generated_async.api.document_payment_api import DocumentPaymentApi +from easybill_generated_async.api.document_version_api import DocumentVersionApi +from easybill_generated_async.api.logins_api import LoginsApi +from easybill_generated_async.api.pdf_templates_api import PdfTemplatesApi +from easybill_generated_async.api.position_api import PositionApi +from easybill_generated_async.api.position_group_api import PositionGroupApi +from easybill_generated_async.api.post_box_api import PostBoxApi +from easybill_generated_async.api.project_api import ProjectApi +from easybill_generated_async.api.sepa_payment_api import SepaPaymentApi +from easybill_generated_async.api.serial_number_api import SerialNumberApi +from easybill_generated_async.api.stock_api import StockApi +from easybill_generated_async.api.task_api import TaskApi +from easybill_generated_async.api.text_template_api import TextTemplateApi +from easybill_generated_async.api.time_tracking_api import TimeTrackingApi +from easybill_generated_async.api.webhook_api import WebhookApi + diff --git a/generated/async/easybill_generated_async/api/attachment_api.py b/generated/async/easybill_generated_async/api/attachment_api.py new file mode 100644 index 0000000..93ae61e --- /dev/null +++ b/generated/async/easybill_generated_async/api/attachment_api.py @@ -0,0 +1,1673 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBytes, StrictInt, StrictStr +from typing import Optional, Tuple, Union +from typing_extensions import Annotated +from easybill_generated_async.models.attachment import Attachment +from easybill_generated_async.models.attachments import Attachments + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class AttachmentApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def attachments_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Attachments: + """Fetch attachments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachments", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def attachments_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Attachments]: + """Fetch attachments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachments", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def attachments_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch attachments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachments", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _attachments_get_serialize( + self, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/attachments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def attachments_id_content_get( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Fetch attachment content + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_content_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def attachments_id_content_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Fetch attachment content + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_content_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def attachments_id_content_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch attachment content + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_content_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _attachments_id_content_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/attachments/{id}/content', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def attachments_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete attachment + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def attachments_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete attachment + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def attachments_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete attachment + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _attachments_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/attachments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def attachments_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Attachment: + """Fetch attachment + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def attachments_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Attachment]: + """Fetch attachment + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def attachments_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch attachment + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _attachments_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/attachments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def attachments_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + body: Attachment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Attachment: + """Update attachment + + + :param id: ID of attachment (required) + :type id: int + :param body: (required) + :type body: Attachment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachment", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def attachments_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + body: Attachment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Attachment]: + """Update attachment + + + :param id: ID of attachment (required) + :type id: int + :param body: (required) + :type body: Attachment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachment", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def attachments_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + body: Attachment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update attachment + + + :param id: ID of attachment (required) + :type id: int + :param body: (required) + :type body: Attachment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachment", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _attachments_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/attachments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def attachments_post( + self, + file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Attachment: + """Create attachment + + + :param file: (required) + :type file: bytes + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_post_serialize( + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Attachment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def attachments_post_with_http_info( + self, + file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Attachment]: + """Create attachment + + + :param file: (required) + :type file: bytes + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_post_serialize( + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Attachment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def attachments_post_without_preload_content( + self, + file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create attachment + + + :param file: (required) + :type file: bytes + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_post_serialize( + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Attachment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _attachments_post_serialize( + self, + file, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + if file is not None: + _files['file'] = file + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/attachments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/contact_api.py b/generated/async/easybill_generated_async/api/contact_api.py new file mode 100644 index 0000000..40856e2 --- /dev/null +++ b/generated/async/easybill_generated_async/api/contact_api.py @@ -0,0 +1,1489 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.contact import Contact +from easybill_generated_async.models.contacts import Contacts + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class ContactApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def customers_customer_id_contacts_get( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer that needs to be fetched")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Contacts: + """Fetch customer contact list + + + :param customer_id: ID of customer that needs to be fetched (required) + :type customer_id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_get_serialize( + customer_id=customer_id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contacts", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_customer_id_contacts_get_with_http_info( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer that needs to be fetched")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Contacts]: + """Fetch customer contact list + + + :param customer_id: ID of customer that needs to be fetched (required) + :type customer_id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_get_serialize( + customer_id=customer_id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contacts", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_customer_id_contacts_get_without_preload_content( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer that needs to be fetched")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch customer contact list + + + :param customer_id: ID of customer that needs to be fetched (required) + :type customer_id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_get_serialize( + customer_id=customer_id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contacts", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_customer_id_contacts_get_serialize( + self, + customer_id, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if customer_id is not None: + _path_params['customerId'] = customer_id + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/customers/{customerId}/contacts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_customer_id_contacts_id_delete( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_delete_serialize( + customer_id=customer_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_customer_id_contacts_id_delete_with_http_info( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_delete_serialize( + customer_id=customer_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_customer_id_contacts_id_delete_without_preload_content( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_delete_serialize( + customer_id=customer_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_customer_id_contacts_id_delete_serialize( + self, + customer_id, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if customer_id is not None: + _path_params['customerId'] = customer_id + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/customers/{customerId}/contacts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_customer_id_contacts_id_get( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Contact: + """Fetch contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_get_serialize( + customer_id=customer_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_customer_id_contacts_id_get_with_http_info( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Contact]: + """Fetch contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_get_serialize( + customer_id=customer_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_customer_id_contacts_id_get_without_preload_content( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_get_serialize( + customer_id=customer_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_customer_id_contacts_id_get_serialize( + self, + customer_id, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if customer_id is not None: + _path_params['customerId'] = customer_id + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/customers/{customerId}/contacts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_customer_id_contacts_id_put( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + body: Optional[Contact] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Contact: + """Update Contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param body: + :type body: Contact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_put_serialize( + customer_id=customer_id, + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_customer_id_contacts_id_put_with_http_info( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + body: Optional[Contact] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Contact]: + """Update Contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param body: + :type body: Contact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_put_serialize( + customer_id=customer_id, + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_customer_id_contacts_id_put_without_preload_content( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + body: Optional[Contact] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param body: + :type body: Contact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_put_serialize( + customer_id=customer_id, + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_customer_id_contacts_id_put_serialize( + self, + customer_id, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if customer_id is not None: + _path_params['customerId'] = customer_id + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/customers/{customerId}/contacts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_customer_id_contacts_post( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + body: Optional[Contact] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Contact: + """Create new contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param body: + :type body: Contact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_post_serialize( + customer_id=customer_id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_customer_id_contacts_post_with_http_info( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + body: Optional[Contact] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Contact]: + """Create new contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param body: + :type body: Contact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_post_serialize( + customer_id=customer_id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_customer_id_contacts_post_without_preload_content( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + body: Optional[Contact] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create new contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param body: + :type body: Contact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_post_serialize( + customer_id=customer_id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_customer_id_contacts_post_serialize( + self, + customer_id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if customer_id is not None: + _path_params['customerId'] = customer_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/customers/{customerId}/contacts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/customer_api.py b/generated/async/easybill_generated_async/api/customer_api.py new file mode 100644 index 0000000..dfa31bf --- /dev/null +++ b/generated/async/easybill_generated_async/api/customer_api.py @@ -0,0 +1,1618 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.customer import Customer +from easybill_generated_async.models.customers import Customers + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class CustomerApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def customers_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + group_id: Annotated[Optional[StrictStr], Field(description="Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id.")] = None, + additional_group_id: Annotated[Optional[StrictStr], Field(description="Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter customers by number. You can add multiple numbers separate by comma like no,no,no.")] = None, + country: Annotated[Optional[StrictStr], Field(description="Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR.")] = None, + zip_code: Annotated[Optional[StrictStr], Field(description="Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip.")] = None, + emails: Annotated[Optional[StrictStr], Field(description="Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail.")] = None, + first_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + last_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + company_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + created_at: Annotated[Optional[StrictStr], Field(description="Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Customers: + """Fetch customers list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param group_id: Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id. + :type group_id: str + :param additional_group_id: Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id. + :type additional_group_id: str + :param number: Filter customers by number. You can add multiple numbers separate by comma like no,no,no. + :type number: str + :param country: Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR. + :type country: str + :param zip_code: Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip. + :type zip_code: str + :param emails: Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail. + :type emails: str + :param first_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type first_name: str + :param last_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type last_name: str + :param company_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type company_name: str + :param created_at: Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type created_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_get_serialize( + limit=limit, + page=page, + group_id=group_id, + additional_group_id=additional_group_id, + number=number, + country=country, + zip_code=zip_code, + emails=emails, + first_name=first_name, + last_name=last_name, + company_name=company_name, + created_at=created_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customers", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + group_id: Annotated[Optional[StrictStr], Field(description="Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id.")] = None, + additional_group_id: Annotated[Optional[StrictStr], Field(description="Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter customers by number. You can add multiple numbers separate by comma like no,no,no.")] = None, + country: Annotated[Optional[StrictStr], Field(description="Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR.")] = None, + zip_code: Annotated[Optional[StrictStr], Field(description="Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip.")] = None, + emails: Annotated[Optional[StrictStr], Field(description="Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail.")] = None, + first_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + last_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + company_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + created_at: Annotated[Optional[StrictStr], Field(description="Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Customers]: + """Fetch customers list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param group_id: Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id. + :type group_id: str + :param additional_group_id: Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id. + :type additional_group_id: str + :param number: Filter customers by number. You can add multiple numbers separate by comma like no,no,no. + :type number: str + :param country: Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR. + :type country: str + :param zip_code: Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip. + :type zip_code: str + :param emails: Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail. + :type emails: str + :param first_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type first_name: str + :param last_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type last_name: str + :param company_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type company_name: str + :param created_at: Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type created_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_get_serialize( + limit=limit, + page=page, + group_id=group_id, + additional_group_id=additional_group_id, + number=number, + country=country, + zip_code=zip_code, + emails=emails, + first_name=first_name, + last_name=last_name, + company_name=company_name, + created_at=created_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customers", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + group_id: Annotated[Optional[StrictStr], Field(description="Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id.")] = None, + additional_group_id: Annotated[Optional[StrictStr], Field(description="Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter customers by number. You can add multiple numbers separate by comma like no,no,no.")] = None, + country: Annotated[Optional[StrictStr], Field(description="Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR.")] = None, + zip_code: Annotated[Optional[StrictStr], Field(description="Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip.")] = None, + emails: Annotated[Optional[StrictStr], Field(description="Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail.")] = None, + first_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + last_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + company_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + created_at: Annotated[Optional[StrictStr], Field(description="Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch customers list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param group_id: Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id. + :type group_id: str + :param additional_group_id: Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id. + :type additional_group_id: str + :param number: Filter customers by number. You can add multiple numbers separate by comma like no,no,no. + :type number: str + :param country: Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR. + :type country: str + :param zip_code: Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip. + :type zip_code: str + :param emails: Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail. + :type emails: str + :param first_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type first_name: str + :param last_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type last_name: str + :param company_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type company_name: str + :param created_at: Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type created_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_get_serialize( + limit=limit, + page=page, + group_id=group_id, + additional_group_id=additional_group_id, + number=number, + country=country, + zip_code=zip_code, + emails=emails, + first_name=first_name, + last_name=last_name, + company_name=company_name, + created_at=created_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customers", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_get_serialize( + self, + limit, + page, + group_id, + additional_group_id, + number, + country, + zip_code, + emails, + first_name, + last_name, + company_name, + created_at, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if group_id is not None: + + _query_params.append(('group_id', group_id)) + + if additional_group_id is not None: + + _query_params.append(('additional_group_id', additional_group_id)) + + if number is not None: + + _query_params.append(('number', number)) + + if country is not None: + + _query_params.append(('country', country)) + + if zip_code is not None: + + _query_params.append(('zip_code', zip_code)) + + if emails is not None: + + _query_params.append(('emails', emails)) + + if first_name is not None: + + _query_params.append(('first_name', first_name)) + + if last_name is not None: + + _query_params.append(('last_name', last_name)) + + if company_name is not None: + + _query_params.append(('company_name', company_name)) + + if created_at is not None: + + _query_params.append(('created_at', created_at)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/customers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete customer + + + :param id: ID of customer that needs to be deleted (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete customer + + + :param id: ID of customer that needs to be deleted (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete customer + + + :param id: ID of customer that needs to be deleted (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/customers/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Customer: + """Fetch customer + + + :param id: ID of customer that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customer", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Customer]: + """Fetch customer + + + :param id: ID of customer that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customer", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch customer + + + :param id: ID of customer that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customer", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/customers/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be updated")], + body: Customer, + type: Annotated[Optional[StrictStr], Field(description="Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Customer: + """Update Customer + + + :param id: ID of customer that needs to be updated (required) + :type id: int + :param body: (required) + :type body: Customer + :param type: Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_put_serialize( + id=id, + body=body, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customer", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be updated")], + body: Customer, + type: Annotated[Optional[StrictStr], Field(description="Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Customer]: + """Update Customer + + + :param id: ID of customer that needs to be updated (required) + :type id: int + :param body: (required) + :type body: Customer + :param type: Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_put_serialize( + id=id, + body=body, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customer", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be updated")], + body: Customer, + type: Annotated[Optional[StrictStr], Field(description="Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Customer + + + :param id: ID of customer that needs to be updated (required) + :type id: int + :param body: (required) + :type body: Customer + :param type: Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_put_serialize( + id=id, + body=body, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customer", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_id_put_serialize( + self, + id, + body, + type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if type is not None: + + _query_params.append(('type', type)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/customers/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_post( + self, + body: Customer, + type: Annotated[Optional[StrictStr], Field(description="Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Customer: + """Create customer + + + :param body: (required) + :type body: Customer + :param type: Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_post_serialize( + body=body, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Customer", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_post_with_http_info( + self, + body: Customer, + type: Annotated[Optional[StrictStr], Field(description="Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Customer]: + """Create customer + + + :param body: (required) + :type body: Customer + :param type: Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_post_serialize( + body=body, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Customer", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_post_without_preload_content( + self, + body: Customer, + type: Annotated[Optional[StrictStr], Field(description="Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create customer + + + :param body: (required) + :type body: Customer + :param type: Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_post_serialize( + body=body, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Customer", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_post_serialize( + self, + body, + type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if type is not None: + + _query_params.append(('type', type)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/customers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/customer_group_api.py b/generated/async/easybill_generated_async/api/customer_group_api.py new file mode 100644 index 0000000..de32d4f --- /dev/null +++ b/generated/async/easybill_generated_async/api/customer_group_api.py @@ -0,0 +1,1411 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.customer_group import CustomerGroup +from easybill_generated_async.models.customer_groups import CustomerGroups + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class CustomerGroupApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def customer_groups_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CustomerGroups: + """Fetch customer group list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customer_groups_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CustomerGroups]: + """Fetch customer group list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customer_groups_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch customer group list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customer_groups_get_serialize( + self, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/customer-groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customer_groups_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of customer group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete customer group + + + :param id: ID of customer group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customer_groups_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of customer group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete customer group + + + :param id: ID of customer group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customer_groups_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of customer group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete customer group + + + :param id: ID of customer group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customer_groups_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/customer-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customer_groups_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of customer group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CustomerGroup: + """Fetch customer group + + + :param id: ID of customer group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customer_groups_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of customer group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CustomerGroup]: + """Fetch customer group + + + :param id: ID of customer group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customer_groups_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of customer group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch customer group + + + :param id: ID of customer group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customer_groups_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/customer-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customer_groups_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of customer goup")], + body: CustomerGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CustomerGroup: + """Update customer group + + + :param id: ID of customer goup (required) + :type id: int + :param body: (required) + :type body: CustomerGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroup", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customer_groups_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of customer goup")], + body: CustomerGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CustomerGroup]: + """Update customer group + + + :param id: ID of customer goup (required) + :type id: int + :param body: (required) + :type body: CustomerGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroup", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customer_groups_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of customer goup")], + body: CustomerGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update customer group + + + :param id: ID of customer goup (required) + :type id: int + :param body: (required) + :type body: CustomerGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroup", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customer_groups_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/customer-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customer_groups_post( + self, + body: CustomerGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CustomerGroup: + """Create customer group + + + :param body: (required) + :type body: CustomerGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CustomerGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customer_groups_post_with_http_info( + self, + body: CustomerGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CustomerGroup]: + """Create customer group + + + :param body: (required) + :type body: CustomerGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CustomerGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customer_groups_post_without_preload_content( + self, + body: CustomerGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create customer group + + + :param body: (required) + :type body: CustomerGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CustomerGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customer_groups_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/customer-groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/discount_api.py b/generated/async/easybill_generated_async/api/discount_api.py new file mode 100644 index 0000000..7934361 --- /dev/null +++ b/generated/async/easybill_generated_async/api/discount_api.py @@ -0,0 +1,2887 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.discount_position import DiscountPosition +from easybill_generated_async.models.discount_position_group import DiscountPositionGroup +from easybill_generated_async.models.discount_position_groups import DiscountPositionGroups +from easybill_generated_async.models.discount_positions import DiscountPositions + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class DiscountApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def discounts_position_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPositions: + """Fetch list of position discounts + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. + :type customer_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPositions]: + """Fetch list of position discounts + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. + :type customer_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch list of position discounts + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. + :type customer_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_get_serialize( + self, + limit, + page, + customer_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if customer_id is not None: + + _query_params.append(('customer_id', customer_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/discounts/position', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_group_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPositionGroups: + """Fetch list of position-group discounts + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. + :type customer_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_group_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPositionGroups]: + """Fetch list of position-group discounts + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. + :type customer_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_group_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch list of position-group discounts + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. + :type customer_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_group_get_serialize( + self, + limit, + page, + customer_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if customer_id is not None: + + _query_params.append(('customer_id', customer_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/discounts/position-group', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_group_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon deleted discount")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the specified position-group discount + + + :param id: ID of the to be soon deleted discount (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_group_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon deleted discount")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the specified position-group discount + + + :param id: ID of the to be soon deleted discount (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_group_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon deleted discount")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the specified position-group discount + + + :param id: ID of the to be soon deleted discount (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_group_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/discounts/position-group/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_group_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of the discount")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPositionGroup: + """Fetch specified position-group discount by id + + + :param id: ID of the discount (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_group_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the discount")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPositionGroup]: + """Fetch specified position-group discount by id + + + :param id: ID of the discount (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_group_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the discount")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch specified position-group discount by id + + + :param id: ID of the discount (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_group_id_get_serialize( + self, + id, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/discounts/position-group/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_group_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon updated discount")], + body: Optional[DiscountPositionGroup] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPositionGroup: + """Update a position-group discount + + + :param id: ID of the to be soon updated discount (required) + :type id: int + :param body: + :type body: DiscountPositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_group_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon updated discount")], + body: Optional[DiscountPositionGroup] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPositionGroup]: + """Update a position-group discount + + + :param id: ID of the to be soon updated discount (required) + :type id: int + :param body: + :type body: DiscountPositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_group_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon updated discount")], + body: Optional[DiscountPositionGroup] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a position-group discount + + + :param id: ID of the to be soon updated discount (required) + :type id: int + :param body: + :type body: DiscountPositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_group_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/discounts/position-group/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_group_post( + self, + body: DiscountPositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPositionGroup: + """Create a new position-group discount + + + :param body: (required) + :type body: DiscountPositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DiscountPositionGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_group_post_with_http_info( + self, + body: DiscountPositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPositionGroup]: + """Create a new position-group discount + + + :param body: (required) + :type body: DiscountPositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DiscountPositionGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_group_post_without_preload_content( + self, + body: DiscountPositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new position-group discount + + + :param body: (required) + :type body: DiscountPositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DiscountPositionGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_group_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/discounts/position-group', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon deleted discount")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the specified position discount + + + :param id: ID of the to be soon deleted discount (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon deleted discount")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the specified position discount + + + :param id: ID of the to be soon deleted discount (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon deleted discount")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the specified position discount + + + :param id: ID of the to be soon deleted discount (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/discounts/position/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of the discount")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPosition: + """Fetch specified position discount by id + + + :param id: ID of the discount (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPosition", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the discount")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPosition]: + """Fetch specified position discount by id + + + :param id: ID of the discount (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPosition", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the discount")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch specified position discount by id + + + :param id: ID of the discount (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPosition", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_id_get_serialize( + self, + id, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/discounts/position/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon updated discount")], + body: Optional[DiscountPosition] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPosition: + """Update a position discount + + + :param id: ID of the to be soon updated discount (required) + :type id: int + :param body: + :type body: DiscountPosition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPosition", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon updated discount")], + body: Optional[DiscountPosition] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPosition]: + """Update a position discount + + + :param id: ID of the to be soon updated discount (required) + :type id: int + :param body: + :type body: DiscountPosition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPosition", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon updated discount")], + body: Optional[DiscountPosition] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a position discount + + + :param id: ID of the to be soon updated discount (required) + :type id: int + :param body: + :type body: DiscountPosition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPosition", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/discounts/position/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_post( + self, + body: DiscountPosition, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPosition: + """Create a new position discount + + + :param body: (required) + :type body: DiscountPosition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DiscountPosition", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_post_with_http_info( + self, + body: DiscountPosition, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPosition]: + """Create a new position discount + + + :param body: (required) + :type body: DiscountPosition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DiscountPosition", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_post_without_preload_content( + self, + body: DiscountPosition, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new position discount + + + :param body: (required) + :type body: DiscountPosition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DiscountPosition", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/discounts/position', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/document_api.py b/generated/async/easybill_generated_async/api/document_api.py new file mode 100644 index 0000000..7b83436 --- /dev/null +++ b/generated/async/easybill_generated_async/api/document_api.py @@ -0,0 +1,3740 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator +from typing import Optional, Tuple, Union +from typing_extensions import Annotated +from easybill_generated_async.models.document import Document +from easybill_generated_async.models.documents import Documents +from easybill_generated_async.models.post_box_request import PostBoxRequest + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class DocumentApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def documents_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT.")] = None, + is_draft: Annotated[Optional[StrictStr], Field(description="Filter documents by draft flag.")] = None, + is_archive: Annotated[Optional[StrictStr], Field(description="Filter documents by archive flag.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id.")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id.")] = None, + ref_id: Annotated[Optional[StrictStr], Field(description="Filter documents by ref_id.")] = None, + document_date: Annotated[Optional[StrictStr], Field(description="Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + paid_at: Annotated[Optional[StrictStr], Field(description="Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents.")] = None, + title: Annotated[Optional[StrictStr], Field(description="Filter documents by title.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter documents by number.")] = None, + cancel_id: Annotated[Optional[StrictStr], Field(description="Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents.")] = None, + fulfillment_country: Annotated[Optional[StrictStr], Field(description="Filter documents by fulfillment_country.")] = None, + vat_country: Annotated[Optional[StrictStr], Field(description="Filter documents by vat_country.")] = None, + shipping_country: Annotated[Optional[StrictStr], Field(description="Filter documents by shipping_country.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter documents by status. Keep in mind that not every document type has a status.")] = None, + edited_at: Annotated[Optional[StrictStr], Field(description="Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Documents: + """Fetch documents list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT. + :type type: str + :param is_draft: Filter documents by draft flag. + :type is_draft: str + :param is_archive: Filter documents by archive flag. + :type is_archive: str + :param customer_id: Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id. + :type customer_id: str + :param project_id: Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id. + :type project_id: str + :param ref_id: Filter documents by ref_id. + :type ref_id: str + :param document_date: Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31. + :type document_date: str + :param paid_at: Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents. + :type paid_at: str + :param title: Filter documents by title. + :type title: str + :param number: Filter documents by number. + :type number: str + :param cancel_id: Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents. + :type cancel_id: str + :param fulfillment_country: Filter documents by fulfillment_country. + :type fulfillment_country: str + :param vat_country: Filter documents by vat_country. + :type vat_country: str + :param shipping_country: Filter documents by shipping_country. + :type shipping_country: str + :param status: Filter documents by status. Keep in mind that not every document type has a status. + :type status: str + :param edited_at: Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type edited_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_get_serialize( + limit=limit, + page=page, + type=type, + is_draft=is_draft, + is_archive=is_archive, + customer_id=customer_id, + project_id=project_id, + ref_id=ref_id, + document_date=document_date, + paid_at=paid_at, + title=title, + number=number, + cancel_id=cancel_id, + fulfillment_country=fulfillment_country, + vat_country=vat_country, + shipping_country=shipping_country, + status=status, + edited_at=edited_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Documents", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT.")] = None, + is_draft: Annotated[Optional[StrictStr], Field(description="Filter documents by draft flag.")] = None, + is_archive: Annotated[Optional[StrictStr], Field(description="Filter documents by archive flag.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id.")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id.")] = None, + ref_id: Annotated[Optional[StrictStr], Field(description="Filter documents by ref_id.")] = None, + document_date: Annotated[Optional[StrictStr], Field(description="Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + paid_at: Annotated[Optional[StrictStr], Field(description="Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents.")] = None, + title: Annotated[Optional[StrictStr], Field(description="Filter documents by title.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter documents by number.")] = None, + cancel_id: Annotated[Optional[StrictStr], Field(description="Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents.")] = None, + fulfillment_country: Annotated[Optional[StrictStr], Field(description="Filter documents by fulfillment_country.")] = None, + vat_country: Annotated[Optional[StrictStr], Field(description="Filter documents by vat_country.")] = None, + shipping_country: Annotated[Optional[StrictStr], Field(description="Filter documents by shipping_country.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter documents by status. Keep in mind that not every document type has a status.")] = None, + edited_at: Annotated[Optional[StrictStr], Field(description="Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Documents]: + """Fetch documents list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT. + :type type: str + :param is_draft: Filter documents by draft flag. + :type is_draft: str + :param is_archive: Filter documents by archive flag. + :type is_archive: str + :param customer_id: Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id. + :type customer_id: str + :param project_id: Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id. + :type project_id: str + :param ref_id: Filter documents by ref_id. + :type ref_id: str + :param document_date: Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31. + :type document_date: str + :param paid_at: Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents. + :type paid_at: str + :param title: Filter documents by title. + :type title: str + :param number: Filter documents by number. + :type number: str + :param cancel_id: Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents. + :type cancel_id: str + :param fulfillment_country: Filter documents by fulfillment_country. + :type fulfillment_country: str + :param vat_country: Filter documents by vat_country. + :type vat_country: str + :param shipping_country: Filter documents by shipping_country. + :type shipping_country: str + :param status: Filter documents by status. Keep in mind that not every document type has a status. + :type status: str + :param edited_at: Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type edited_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_get_serialize( + limit=limit, + page=page, + type=type, + is_draft=is_draft, + is_archive=is_archive, + customer_id=customer_id, + project_id=project_id, + ref_id=ref_id, + document_date=document_date, + paid_at=paid_at, + title=title, + number=number, + cancel_id=cancel_id, + fulfillment_country=fulfillment_country, + vat_country=vat_country, + shipping_country=shipping_country, + status=status, + edited_at=edited_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Documents", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT.")] = None, + is_draft: Annotated[Optional[StrictStr], Field(description="Filter documents by draft flag.")] = None, + is_archive: Annotated[Optional[StrictStr], Field(description="Filter documents by archive flag.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id.")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id.")] = None, + ref_id: Annotated[Optional[StrictStr], Field(description="Filter documents by ref_id.")] = None, + document_date: Annotated[Optional[StrictStr], Field(description="Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + paid_at: Annotated[Optional[StrictStr], Field(description="Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents.")] = None, + title: Annotated[Optional[StrictStr], Field(description="Filter documents by title.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter documents by number.")] = None, + cancel_id: Annotated[Optional[StrictStr], Field(description="Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents.")] = None, + fulfillment_country: Annotated[Optional[StrictStr], Field(description="Filter documents by fulfillment_country.")] = None, + vat_country: Annotated[Optional[StrictStr], Field(description="Filter documents by vat_country.")] = None, + shipping_country: Annotated[Optional[StrictStr], Field(description="Filter documents by shipping_country.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter documents by status. Keep in mind that not every document type has a status.")] = None, + edited_at: Annotated[Optional[StrictStr], Field(description="Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch documents list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT. + :type type: str + :param is_draft: Filter documents by draft flag. + :type is_draft: str + :param is_archive: Filter documents by archive flag. + :type is_archive: str + :param customer_id: Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id. + :type customer_id: str + :param project_id: Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id. + :type project_id: str + :param ref_id: Filter documents by ref_id. + :type ref_id: str + :param document_date: Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31. + :type document_date: str + :param paid_at: Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents. + :type paid_at: str + :param title: Filter documents by title. + :type title: str + :param number: Filter documents by number. + :type number: str + :param cancel_id: Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents. + :type cancel_id: str + :param fulfillment_country: Filter documents by fulfillment_country. + :type fulfillment_country: str + :param vat_country: Filter documents by vat_country. + :type vat_country: str + :param shipping_country: Filter documents by shipping_country. + :type shipping_country: str + :param status: Filter documents by status. Keep in mind that not every document type has a status. + :type status: str + :param edited_at: Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type edited_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_get_serialize( + limit=limit, + page=page, + type=type, + is_draft=is_draft, + is_archive=is_archive, + customer_id=customer_id, + project_id=project_id, + ref_id=ref_id, + document_date=document_date, + paid_at=paid_at, + title=title, + number=number, + cancel_id=cancel_id, + fulfillment_country=fulfillment_country, + vat_country=vat_country, + shipping_country=shipping_country, + status=status, + edited_at=edited_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Documents", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_get_serialize( + self, + limit, + page, + type, + is_draft, + is_archive, + customer_id, + project_id, + ref_id, + document_date, + paid_at, + title, + number, + cancel_id, + fulfillment_country, + vat_country, + shipping_country, + status, + edited_at, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if type is not None: + + _query_params.append(('type', type)) + + if is_draft is not None: + + _query_params.append(('is_draft', is_draft)) + + if is_archive is not None: + + _query_params.append(('is_archive', is_archive)) + + if customer_id is not None: + + _query_params.append(('customer_id', customer_id)) + + if project_id is not None: + + _query_params.append(('project_id', project_id)) + + if ref_id is not None: + + _query_params.append(('ref_id', ref_id)) + + if document_date is not None: + + _query_params.append(('document_date', document_date)) + + if paid_at is not None: + + _query_params.append(('paid_at', paid_at)) + + if title is not None: + + _query_params.append(('title', title)) + + if number is not None: + + _query_params.append(('number', number)) + + if cancel_id is not None: + + _query_params.append(('cancel_id', cancel_id)) + + if fulfillment_country is not None: + + _query_params.append(('fulfillment_country', fulfillment_country)) + + if vat_country is not None: + + _query_params.append(('vat_country', vat_country)) + + if shipping_country is not None: + + _query_params.append(('shipping_country', shipping_country)) + + if status is not None: + + _query_params.append(('status', status)) + + if edited_at is not None: + + _query_params.append(('edited_at', edited_at)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_cancel_post( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + use_text_from_template: Annotated[Optional[StrictBool], Field(description="Use standard texts from the template.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Document: + """Cancel document + + + :param id: ID of document (required) + :type id: int + :param use_text_from_template: Use standard texts from the template. + :type use_text_from_template: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_cancel_post_serialize( + id=id, + use_text_from_template=use_text_from_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_cancel_post_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + use_text_from_template: Annotated[Optional[StrictBool], Field(description="Use standard texts from the template.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Document]: + """Cancel document + + + :param id: ID of document (required) + :type id: int + :param use_text_from_template: Use standard texts from the template. + :type use_text_from_template: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_cancel_post_serialize( + id=id, + use_text_from_template=use_text_from_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_cancel_post_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + use_text_from_template: Annotated[Optional[StrictBool], Field(description="Use standard texts from the template.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Cancel document + + + :param id: ID of document (required) + :type id: int + :param use_text_from_template: Use standard texts from the template. + :type use_text_from_template: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_cancel_post_serialize( + id=id, + use_text_from_template=use_text_from_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_cancel_post_serialize( + self, + id, + use_text_from_template, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if use_text_from_template is not None: + + _query_params.append(('use_text_from_template', use_text_from_template)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/documents/{id}/cancel', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/documents/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_done_put( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + reason_for_change: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="A string that is saved on the document version as reason.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Document: + """To complete a document. + + + :param id: ID of document (required) + :type id: int + :param reason_for_change: A string that is saved on the document version as reason. + :type reason_for_change: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_done_put_serialize( + id=id, + reason_for_change=reason_for_change, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_done_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + reason_for_change: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="A string that is saved on the document version as reason.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Document]: + """To complete a document. + + + :param id: ID of document (required) + :type id: int + :param reason_for_change: A string that is saved on the document version as reason. + :type reason_for_change: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_done_put_serialize( + id=id, + reason_for_change=reason_for_change, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_done_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + reason_for_change: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="A string that is saved on the document version as reason.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """To complete a document. + + + :param id: ID of document (required) + :type id: int + :param reason_for_change: A string that is saved on the document version as reason. + :type reason_for_change: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_done_put_serialize( + id=id, + reason_for_change=reason_for_change, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_done_put_serialize( + self, + id, + reason_for_change, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if reason_for_change is not None: + + _query_params.append(('reason_for_change', reason_for_change)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/documents/{id}/done', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_download_get( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + accept: Annotated[Optional[StrictStr], Field(description="The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Fetch the document in best fitting format to the given Accept header + + + :param id: ID of document (required) + :type id: int + :param accept: The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher. + :type accept: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_download_get_serialize( + id=id, + accept=accept, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '406': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_download_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + accept: Annotated[Optional[StrictStr], Field(description="The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Fetch the document in best fitting format to the given Accept header + + + :param id: ID of document (required) + :type id: int + :param accept: The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher. + :type accept: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_download_get_serialize( + id=id, + accept=accept, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '406': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_download_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + accept: Annotated[Optional[StrictStr], Field(description="The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch the document in best fitting format to the given Accept header + + + :param id: ID of document (required) + :type id: int + :param accept: The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher. + :type accept: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_download_get_serialize( + id=id, + accept=accept, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '406': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_download_get_serialize( + self, + id, + accept, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + if accept is not None: + _header_params['Accept'] = accept + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/pdf', + 'application/pdf;format=zugferd;version=1.0.0', + 'application/pdf;format=zugferd;version=2.2.0', + 'application/xml;format=xrechnung;version=2.3.0', + 'application/xml;format=xrechnung;version=3.0.1' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents/{id}/download', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Document: + """Fetch document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Document]: + """Fetch document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_jpg_get( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + offset: Annotated[Optional[StrictInt], Field(description="The page of the document where the image should start.")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The page of the document where the image should end.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Download a document as an jpeg-image + + + :param id: ID of document (required) + :type id: int + :param offset: The page of the document where the image should start. + :type offset: int + :param limit: The page of the document where the image should end. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_jpg_get_serialize( + id=id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_jpg_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + offset: Annotated[Optional[StrictInt], Field(description="The page of the document where the image should start.")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The page of the document where the image should end.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Download a document as an jpeg-image + + + :param id: ID of document (required) + :type id: int + :param offset: The page of the document where the image should start. + :type offset: int + :param limit: The page of the document where the image should end. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_jpg_get_serialize( + id=id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_jpg_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + offset: Annotated[Optional[StrictInt], Field(description="The page of the document where the image should start.")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The page of the document where the image should end.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Download a document as an jpeg-image + + + :param id: ID of document (required) + :type id: int + :param offset: The page of the document where the image should start. + :type offset: int + :param limit: The page of the document where the image should end. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_jpg_get_serialize( + id=id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_jpg_get_serialize( + self, + id, + offset, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'image/jpeg' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents/{id}/jpg', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_pdf_get( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Fetch pdf document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_pdf_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_pdf_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Fetch pdf document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_pdf_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_pdf_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch pdf document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_pdf_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_pdf_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/pdf' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents/{id}/pdf', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + body: Document, + refresh_customer_data: Annotated[Optional[StrictBool], Field(description="Forces refreshing of the customer data.")] = None, + reason_for_change: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Document: + """Update document + + + :param id: ID of document (required) + :type id: int + :param body: (required) + :type body: Document + :param refresh_customer_data: Forces refreshing of the customer data. + :type refresh_customer_data: bool + :param reason_for_change: A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value. + :type reason_for_change: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_put_serialize( + id=id, + body=body, + refresh_customer_data=refresh_customer_data, + reason_for_change=reason_for_change, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '400': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + body: Document, + refresh_customer_data: Annotated[Optional[StrictBool], Field(description="Forces refreshing of the customer data.")] = None, + reason_for_change: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Document]: + """Update document + + + :param id: ID of document (required) + :type id: int + :param body: (required) + :type body: Document + :param refresh_customer_data: Forces refreshing of the customer data. + :type refresh_customer_data: bool + :param reason_for_change: A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value. + :type reason_for_change: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_put_serialize( + id=id, + body=body, + refresh_customer_data=refresh_customer_data, + reason_for_change=reason_for_change, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '400': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + body: Document, + refresh_customer_data: Annotated[Optional[StrictBool], Field(description="Forces refreshing of the customer data.")] = None, + reason_for_change: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update document + + + :param id: ID of document (required) + :type id: int + :param body: (required) + :type body: Document + :param refresh_customer_data: Forces refreshing of the customer data. + :type refresh_customer_data: bool + :param reason_for_change: A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value. + :type reason_for_change: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_put_serialize( + id=id, + body=body, + refresh_customer_data=refresh_customer_data, + reason_for_change=reason_for_change, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '400': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_put_serialize( + self, + id, + body, + refresh_customer_data, + reason_for_change, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if refresh_customer_data is not None: + + _query_params.append(('refresh_customer_data', refresh_customer_data)) + + if reason_for_change is not None: + + _query_params.append(('reason_for_change', reason_for_change)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/documents/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_send_type_post( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + type: StrictStr, + body: PostBoxRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Send document + + + :param id: ID of document (required) + :type id: int + :param type: (required) + :type type: str + :param body: (required) + :type body: PostBoxRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_send_type_post_serialize( + id=id, + type=type, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_send_type_post_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + type: StrictStr, + body: PostBoxRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Send document + + + :param id: ID of document (required) + :type id: int + :param type: (required) + :type type: str + :param body: (required) + :type body: PostBoxRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_send_type_post_serialize( + id=id, + type=type, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_send_type_post_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + type: StrictStr, + body: PostBoxRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Send document + + + :param id: ID of document (required) + :type id: int + :param type: (required) + :type type: str + :param body: (required) + :type body: PostBoxRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_send_type_post_serialize( + id=id, + type=type, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_send_type_post_serialize( + self, + id, + type, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + if type is not None: + _path_params['type'] = type + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/documents/{id}/send/{type}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_type_post( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + type: Annotated[StrictStr, Field(description="The target document type")], + pdf_template: Annotated[Optional[StrictStr], Field(description="The ID of the printer template to use. Defaults to 'DE' if not given.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Document: + """Convert an existing document to one of a different type + + + :param id: ID of document (required) + :type id: int + :param type: The target document type (required) + :type type: str + :param pdf_template: The ID of the printer template to use. Defaults to 'DE' if not given. + :type pdf_template: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_type_post_serialize( + id=id, + type=type, + pdf_template=pdf_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Document", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_type_post_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + type: Annotated[StrictStr, Field(description="The target document type")], + pdf_template: Annotated[Optional[StrictStr], Field(description="The ID of the printer template to use. Defaults to 'DE' if not given.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Document]: + """Convert an existing document to one of a different type + + + :param id: ID of document (required) + :type id: int + :param type: The target document type (required) + :type type: str + :param pdf_template: The ID of the printer template to use. Defaults to 'DE' if not given. + :type pdf_template: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_type_post_serialize( + id=id, + type=type, + pdf_template=pdf_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Document", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_type_post_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + type: Annotated[StrictStr, Field(description="The target document type")], + pdf_template: Annotated[Optional[StrictStr], Field(description="The ID of the printer template to use. Defaults to 'DE' if not given.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Convert an existing document to one of a different type + + + :param id: ID of document (required) + :type id: int + :param type: The target document type (required) + :type type: str + :param pdf_template: The ID of the printer template to use. Defaults to 'DE' if not given. + :type pdf_template: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_type_post_serialize( + id=id, + type=type, + pdf_template=pdf_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Document", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_type_post_serialize( + self, + id, + type, + pdf_template, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + if type is not None: + _path_params['type'] = type + # process the query parameters + if pdf_template is not None: + + _query_params.append(('pdf_template', pdf_template)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/documents/{id}/{type}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_post( + self, + body: Document, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Document: + """Create document + + + :param body: (required) + :type body: Document + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Document", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_post_with_http_info( + self, + body: Document, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Document]: + """Create document + + + :param body: (required) + :type body: Document + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Document", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_post_without_preload_content( + self, + body: Document, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create document + + + :param body: (required) + :type body: Document + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Document", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/documents', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/document_payment_api.py b/generated/async/easybill_generated_async/api/document_payment_api.py new file mode 100644 index 0000000..3ce9b88 --- /dev/null +++ b/generated/async/easybill_generated_async/api/document_payment_api.py @@ -0,0 +1,1186 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.document_payment import DocumentPayment +from easybill_generated_async.models.document_payments import DocumentPayments + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class DocumentPaymentApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def document_payments_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter payments by document_id. You can add multiple ids separate by comma like id,id,id.")] = None, + payment_at: Annotated[Optional[StrictStr], Field(description="Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + reference: Annotated[Optional[StrictStr], Field(description="Filter payments by reference. You can add multiple references separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DocumentPayments: + """Fetch document payments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param document_id: Filter payments by document_id. You can add multiple ids separate by comma like id,id,id. + :type document_id: str + :param payment_at: Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type payment_at: str + :param reference: Filter payments by reference. You can add multiple references separate by comma like id,id,id. + :type reference: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_get_serialize( + limit=limit, + page=page, + document_id=document_id, + payment_at=payment_at, + reference=reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentPayments", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def document_payments_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter payments by document_id. You can add multiple ids separate by comma like id,id,id.")] = None, + payment_at: Annotated[Optional[StrictStr], Field(description="Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + reference: Annotated[Optional[StrictStr], Field(description="Filter payments by reference. You can add multiple references separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocumentPayments]: + """Fetch document payments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param document_id: Filter payments by document_id. You can add multiple ids separate by comma like id,id,id. + :type document_id: str + :param payment_at: Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type payment_at: str + :param reference: Filter payments by reference. You can add multiple references separate by comma like id,id,id. + :type reference: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_get_serialize( + limit=limit, + page=page, + document_id=document_id, + payment_at=payment_at, + reference=reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentPayments", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def document_payments_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter payments by document_id. You can add multiple ids separate by comma like id,id,id.")] = None, + payment_at: Annotated[Optional[StrictStr], Field(description="Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + reference: Annotated[Optional[StrictStr], Field(description="Filter payments by reference. You can add multiple references separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch document payments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param document_id: Filter payments by document_id. You can add multiple ids separate by comma like id,id,id. + :type document_id: str + :param payment_at: Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type payment_at: str + :param reference: Filter payments by reference. You can add multiple references separate by comma like id,id,id. + :type reference: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_get_serialize( + limit=limit, + page=page, + document_id=document_id, + payment_at=payment_at, + reference=reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentPayments", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _document_payments_get_serialize( + self, + limit, + page, + document_id, + payment_at, + reference, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if document_id is not None: + + _query_params.append(('document_id', document_id)) + + if payment_at is not None: + + _query_params.append(('payment_at', payment_at)) + + if reference is not None: + + _query_params.append(('reference', reference)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/document-payments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def document_payments_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of document payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete document payment + + + :param id: ID of document payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def document_payments_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete document payment + + + :param id: ID of document payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def document_payments_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete document payment + + + :param id: ID of document payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _document_payments_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/document-payments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def document_payments_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of document payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DocumentPayment: + """Fetch document payment + + + :param id: ID of document payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentPayment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def document_payments_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocumentPayment]: + """Fetch document payment + + + :param id: ID of document payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentPayment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def document_payments_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch document payment + + + :param id: ID of document payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentPayment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _document_payments_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/document-payments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def document_payments_post( + self, + body: DocumentPayment, + paid: Annotated[Optional[StrictBool], Field(description="Mark document as paid when amount less then payment amount.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DocumentPayment: + """Create document payment + + + :param body: (required) + :type body: DocumentPayment + :param paid: Mark document as paid when amount less then payment amount. + :type paid: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_post_serialize( + body=body, + paid=paid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DocumentPayment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def document_payments_post_with_http_info( + self, + body: DocumentPayment, + paid: Annotated[Optional[StrictBool], Field(description="Mark document as paid when amount less then payment amount.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocumentPayment]: + """Create document payment + + + :param body: (required) + :type body: DocumentPayment + :param paid: Mark document as paid when amount less then payment amount. + :type paid: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_post_serialize( + body=body, + paid=paid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DocumentPayment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def document_payments_post_without_preload_content( + self, + body: DocumentPayment, + paid: Annotated[Optional[StrictBool], Field(description="Mark document as paid when amount less then payment amount.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create document payment + + + :param body: (required) + :type body: DocumentPayment + :param paid: Mark document as paid when amount less then payment amount. + :type paid: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_post_serialize( + body=body, + paid=paid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DocumentPayment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _document_payments_post_serialize( + self, + body, + paid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if paid is not None: + + _query_params.append(('paid', paid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/document-payments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/document_version_api.py b/generated/async/easybill_generated_async/api/document_version_api.py new file mode 100644 index 0000000..21f6d19 --- /dev/null +++ b/generated/async/easybill_generated_async/api/document_version_api.py @@ -0,0 +1,911 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBytes, StrictInt, StrictStr +from typing import Optional, Tuple, Union +from typing_extensions import Annotated +from easybill_generated_async.models.document_version import DocumentVersion +from easybill_generated_async.models.document_versions import DocumentVersions + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class DocumentVersionApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def documents_id_versions_get( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DocumentVersions: + """List all versions of a given document + + + :param id: ID of document (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentVersions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_versions_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocumentVersions]: + """List all versions of a given document + + + :param id: ID of document (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentVersions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_versions_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all versions of a given document + + + :param id: ID of document (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentVersions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_versions_get_serialize( + self, + id, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents/{id}/versions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_versions_version_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + version_id: Annotated[StrictInt, Field(description="ID of document version")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DocumentVersion: + """Show a single version of a given document + + + :param id: ID of document (required) + :type id: int + :param version_id: ID of document version (required) + :type version_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_version_id_get_serialize( + id=id, + version_id=version_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentVersion", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_versions_version_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + version_id: Annotated[StrictInt, Field(description="ID of document version")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocumentVersion]: + """Show a single version of a given document + + + :param id: ID of document (required) + :type id: int + :param version_id: ID of document version (required) + :type version_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_version_id_get_serialize( + id=id, + version_id=version_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentVersion", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_versions_version_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + version_id: Annotated[StrictInt, Field(description="ID of document version")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Show a single version of a given document + + + :param id: ID of document (required) + :type id: int + :param version_id: ID of document version (required) + :type version_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_version_id_get_serialize( + id=id, + version_id=version_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentVersion", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_versions_version_id_get_serialize( + self, + id, + version_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + if version_id is not None: + _path_params['versionId'] = version_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents/{id}/versions/{versionId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_versions_version_id_items_version_item_id_download_get( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + version_id: Annotated[StrictInt, Field(description="ID of document version")], + version_item_id: Annotated[StrictInt, Field(description="ID of document version item")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Download a specific file for a single version of a given document + + + :param id: ID of document (required) + :type id: int + :param version_id: ID of document version (required) + :type version_id: int + :param version_item_id: ID of document version item (required) + :type version_item_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_version_id_items_version_item_id_download_get_serialize( + id=id, + version_id=version_id, + version_item_id=version_item_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_versions_version_id_items_version_item_id_download_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + version_id: Annotated[StrictInt, Field(description="ID of document version")], + version_item_id: Annotated[StrictInt, Field(description="ID of document version item")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Download a specific file for a single version of a given document + + + :param id: ID of document (required) + :type id: int + :param version_id: ID of document version (required) + :type version_id: int + :param version_item_id: ID of document version item (required) + :type version_item_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_version_id_items_version_item_id_download_get_serialize( + id=id, + version_id=version_id, + version_item_id=version_item_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_versions_version_id_items_version_item_id_download_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + version_id: Annotated[StrictInt, Field(description="ID of document version")], + version_item_id: Annotated[StrictInt, Field(description="ID of document version item")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Download a specific file for a single version of a given document + + + :param id: ID of document (required) + :type id: int + :param version_id: ID of document version (required) + :type version_id: int + :param version_item_id: ID of document version item (required) + :type version_item_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_version_id_items_version_item_id_download_get_serialize( + id=id, + version_id=version_id, + version_item_id=version_item_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_versions_version_id_items_version_item_id_download_get_serialize( + self, + id, + version_id, + version_item_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + if version_id is not None: + _path_params['versionId'] = version_id + if version_item_id is not None: + _path_params['versionItemId'] = version_item_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/pdf', + 'text/xml' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents/{id}/versions/{versionId}/items/{versionItemId}/download', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/logins_api.py b/generated/async/easybill_generated_async/api/logins_api.py new file mode 100644 index 0000000..05093c3 --- /dev/null +++ b/generated/async/easybill_generated_async/api/logins_api.py @@ -0,0 +1,582 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.login import Login +from easybill_generated_async.models.logins import Logins + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class LoginsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def logins_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Logins: + """logins_get + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logins_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Logins", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def logins_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Logins]: + """logins_get + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logins_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Logins", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def logins_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """logins_get + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logins_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Logins", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _logins_get_serialize( + self, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/logins', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def logins_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of the login that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Login: + """logins_id_get + + + :param id: ID of the login that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logins_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Login", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def logins_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the login that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Login]: + """logins_id_get + + + :param id: ID of the login that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logins_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Login", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def logins_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the login that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """logins_id_get + + + :param id: ID of the login that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logins_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Login", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _logins_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/logins/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/pdf_templates_api.py b/generated/async/easybill_generated_async/api/pdf_templates_api.py new file mode 100644 index 0000000..dfe497f --- /dev/null +++ b/generated/async/easybill_generated_async/api/pdf_templates_api.py @@ -0,0 +1,303 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from easybill_generated_async.models.pdf_templates import PDFTemplates + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class PdfTemplatesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def pdf_templates_get( + self, + type: Annotated[Optional[List[StrictStr]], Field(description="Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PDFTemplates: + """Fetch PDF Templates list + + + :param type: Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type. + :type type: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pdf_templates_get_serialize( + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PDFTemplates", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def pdf_templates_get_with_http_info( + self, + type: Annotated[Optional[List[StrictStr]], Field(description="Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PDFTemplates]: + """Fetch PDF Templates list + + + :param type: Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type. + :type type: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pdf_templates_get_serialize( + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PDFTemplates", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def pdf_templates_get_without_preload_content( + self, + type: Annotated[Optional[List[StrictStr]], Field(description="Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch PDF Templates list + + + :param type: Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type. + :type type: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pdf_templates_get_serialize( + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PDFTemplates", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pdf_templates_get_serialize( + self, + type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'type': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if type is not None: + + _query_params.append(('type', type)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pdf-templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/position_api.py b/generated/async/easybill_generated_async/api/position_api.py new file mode 100644 index 0000000..336734b --- /dev/null +++ b/generated/async/easybill_generated_async/api/position_api.py @@ -0,0 +1,1445 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.position import Position +from easybill_generated_async.models.positions import Positions + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class PositionApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def positions_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter positions by type.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter positions by number. You can add multiple numbers separate by comma like no,no,no.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Positions: + """Fetch positions list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter positions by type. + :type type: str + :param number: Filter positions by number. You can add multiple numbers separate by comma like no,no,no. + :type number: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_get_serialize( + limit=limit, + page=page, + type=type, + number=number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Positions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def positions_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter positions by type.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter positions by number. You can add multiple numbers separate by comma like no,no,no.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Positions]: + """Fetch positions list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter positions by type. + :type type: str + :param number: Filter positions by number. You can add multiple numbers separate by comma like no,no,no. + :type number: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_get_serialize( + limit=limit, + page=page, + type=type, + number=number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Positions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def positions_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter positions by type.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter positions by number. You can add multiple numbers separate by comma like no,no,no.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch positions list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter positions by type. + :type type: str + :param number: Filter positions by number. You can add multiple numbers separate by comma like no,no,no. + :type number: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_get_serialize( + limit=limit, + page=page, + type=type, + number=number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Positions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _positions_get_serialize( + self, + limit, + page, + type, + number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if type is not None: + + _query_params.append(('type', type)) + + if number is not None: + + _query_params.append(('number', number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/positions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def positions_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete position + + + :param id: ID of position (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def positions_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete position + + + :param id: ID of position (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def positions_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete position + + + :param id: ID of position (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _positions_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/positions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def positions_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Position: + """Fetch position + + + :param id: ID of position (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Position", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def positions_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Position]: + """Fetch position + + + :param id: ID of position (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Position", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def positions_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch position + + + :param id: ID of position (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Position", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _positions_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/positions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def positions_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + body: Position, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Position: + """Update position + + + :param id: ID of position (required) + :type id: int + :param body: (required) + :type body: Position + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Position", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def positions_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + body: Position, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Position]: + """Update position + + + :param id: ID of position (required) + :type id: int + :param body: (required) + :type body: Position + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Position", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def positions_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + body: Position, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update position + + + :param id: ID of position (required) + :type id: int + :param body: (required) + :type body: Position + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Position", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _positions_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/positions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def positions_post( + self, + body: Position, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Position: + """Create position + + + :param body: (required) + :type body: Position + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Position", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def positions_post_with_http_info( + self, + body: Position, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Position]: + """Create position + + + :param body: (required) + :type body: Position + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Position", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def positions_post_without_preload_content( + self, + body: Position, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create position + + + :param body: (required) + :type body: Position + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Position", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _positions_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/positions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/position_group_api.py b/generated/async/easybill_generated_async/api/position_group_api.py new file mode 100644 index 0000000..e859087 --- /dev/null +++ b/generated/async/easybill_generated_async/api/position_group_api.py @@ -0,0 +1,1411 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.position_group import PositionGroup +from easybill_generated_async.models.position_groups import PositionGroups + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class PositionGroupApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def position_groups_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PositionGroups: + """Fetch position group list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def position_groups_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PositionGroups]: + """Fetch position group list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def position_groups_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch position group list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _position_groups_get_serialize( + self, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/position-groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def position_groups_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of position group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete position group + + + :param id: ID of position group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def position_groups_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of position group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete position group + + + :param id: ID of position group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def position_groups_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of position group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete position group + + + :param id: ID of position group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _position_groups_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/position-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def position_groups_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of position group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PositionGroup: + """Fetch position group + + + :param id: ID of position group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def position_groups_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of position group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PositionGroup]: + """Fetch position group + + + :param id: ID of position group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def position_groups_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of position group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch position group + + + :param id: ID of position group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _position_groups_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/position-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def position_groups_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of position goup")], + body: PositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PositionGroup: + """Update position group + + + :param id: ID of position goup (required) + :type id: int + :param body: (required) + :type body: PositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroup", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def position_groups_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of position goup")], + body: PositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PositionGroup]: + """Update position group + + + :param id: ID of position goup (required) + :type id: int + :param body: (required) + :type body: PositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroup", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def position_groups_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of position goup")], + body: PositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update position group + + + :param id: ID of position goup (required) + :type id: int + :param body: (required) + :type body: PositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroup", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _position_groups_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/position-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def position_groups_post( + self, + body: PositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PositionGroup: + """Create position group + + + :param body: (required) + :type body: PositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PositionGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def position_groups_post_with_http_info( + self, + body: PositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PositionGroup]: + """Create position group + + + :param body: (required) + :type body: PositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PositionGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def position_groups_post_without_preload_content( + self, + body: PositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create position group + + + :param body: (required) + :type body: PositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PositionGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _position_groups_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/position-groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/post_box_api.py b/generated/async/easybill_generated_async/api/post_box_api.py new file mode 100644 index 0000000..d9a86b4 --- /dev/null +++ b/generated/async/easybill_generated_async/api/post_box_api.py @@ -0,0 +1,894 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.post_box import PostBox +from easybill_generated_async.models.post_boxes import PostBoxes + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class PostBoxApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def post_boxes_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter post boxes by status.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PostBoxes: + """Fetch post box list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX. + :type type: str + :param status: Filter post boxes by status. + :type status: str + :param document_id: Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_get_serialize( + limit=limit, + page=page, + type=type, + status=status, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostBoxes", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def post_boxes_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter post boxes by status.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PostBoxes]: + """Fetch post box list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX. + :type type: str + :param status: Filter post boxes by status. + :type status: str + :param document_id: Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_get_serialize( + limit=limit, + page=page, + type=type, + status=status, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostBoxes", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def post_boxes_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter post boxes by status.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch post box list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX. + :type type: str + :param status: Filter post boxes by status. + :type status: str + :param document_id: Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_get_serialize( + limit=limit, + page=page, + type=type, + status=status, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostBoxes", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _post_boxes_get_serialize( + self, + limit, + page, + type, + status, + document_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if type is not None: + + _query_params.append(('type', type)) + + if status is not None: + + _query_params.append(('status', status)) + + if document_id is not None: + + _query_params.append(('document_id', document_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/post-boxes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def post_boxes_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of post box")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete post box + + + :param id: ID of post box (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def post_boxes_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of post box")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete post box + + + :param id: ID of post box (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def post_boxes_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of post box")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete post box + + + :param id: ID of post box (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _post_boxes_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/post-boxes/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def post_boxes_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of post box")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PostBox: + """Fetch post box + + + :param id: ID of post box (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostBox", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def post_boxes_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of post box")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PostBox]: + """Fetch post box + + + :param id: ID of post box (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostBox", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def post_boxes_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of post box")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch post box + + + :param id: ID of post box (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostBox", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _post_boxes_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/post-boxes/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/project_api.py b/generated/async/easybill_generated_async/api/project_api.py new file mode 100644 index 0000000..defa498 --- /dev/null +++ b/generated/async/easybill_generated_async/api/project_api.py @@ -0,0 +1,1445 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.project import Project +from easybill_generated_async.models.projects import Projects + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class ProjectApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def projects_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter projects by status.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Projects: + """Fetch projects list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id. + :type customer_id: str + :param status: Filter projects by status. + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Projects", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def projects_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter projects by status.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Projects]: + """Fetch projects list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id. + :type customer_id: str + :param status: Filter projects by status. + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Projects", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def projects_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter projects by status.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch projects list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id. + :type customer_id: str + :param status: Filter projects by status. + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Projects", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _projects_get_serialize( + self, + limit, + page, + customer_id, + status, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if customer_id is not None: + + _query_params.append(('customer_id', customer_id)) + + if status is not None: + + _query_params.append(('status', status)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def projects_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete project + + + :param id: ID of project (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def projects_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete project + + + :param id: ID of project (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def projects_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete project + + + :param id: ID of project (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _projects_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/projects/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def projects_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Fetch project + + + :param id: ID of project (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def projects_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Fetch project + + + :param id: ID of project (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def projects_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch project + + + :param id: ID of project (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _projects_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def projects_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + body: Project, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Update project + + + :param id: ID of project (required) + :type id: int + :param body: (required) + :type body: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def projects_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + body: Project, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Update project + + + :param id: ID of project (required) + :type id: int + :param body: (required) + :type body: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def projects_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + body: Project, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update project + + + :param id: ID of project (required) + :type id: int + :param body: (required) + :type body: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _projects_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/projects/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def projects_post( + self, + body: Project, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Create project + + + :param body: (required) + :type body: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Project", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def projects_post_with_http_info( + self, + body: Project, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Create project + + + :param body: (required) + :type body: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Project", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def projects_post_without_preload_content( + self, + body: Project, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create project + + + :param body: (required) + :type body: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Project", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _projects_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/sepa_payment_api.py b/generated/async/easybill_generated_async/api/sepa_payment_api.py new file mode 100644 index 0000000..70e5dfe --- /dev/null +++ b/generated/async/easybill_generated_async/api/sepa_payment_api.py @@ -0,0 +1,1428 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.sepa_payment import SEPAPayment +from easybill_generated_async.models.sepa_payments import SEPAPayments + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class SepaPaymentApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def sepa_payments_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SEPAPayments: + """Fetch SEPA payments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param document_id: Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_get_serialize( + limit=limit, + page=page, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayments", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sepa_payments_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SEPAPayments]: + """Fetch SEPA payments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param document_id: Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_get_serialize( + limit=limit, + page=page, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayments", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sepa_payments_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch SEPA payments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param document_id: Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_get_serialize( + limit=limit, + page=page, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayments", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sepa_payments_get_serialize( + self, + limit, + page, + document_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if document_id is not None: + + _query_params.append(('document_id', document_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sepa-payments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sepa_payments_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of SPEA payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete SEPA payment + + + :param id: ID of SPEA payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sepa_payments_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of SPEA payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete SEPA payment + + + :param id: ID of SPEA payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sepa_payments_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of SPEA payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete SEPA payment + + + :param id: ID of SPEA payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sepa_payments_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/sepa-payments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sepa_payments_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of SEPA payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SEPAPayment: + """Fetch SEPA payment + + + :param id: ID of SEPA payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sepa_payments_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of SEPA payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SEPAPayment]: + """Fetch SEPA payment + + + :param id: ID of SEPA payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sepa_payments_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of SEPA payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch SEPA payment + + + :param id: ID of SEPA payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sepa_payments_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sepa-payments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sepa_payments_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of SEPA payment")], + body: SEPAPayment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SEPAPayment: + """Update SEPA payment + + + :param id: ID of SEPA payment (required) + :type id: int + :param body: (required) + :type body: SEPAPayment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayment", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sepa_payments_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of SEPA payment")], + body: SEPAPayment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SEPAPayment]: + """Update SEPA payment + + + :param id: ID of SEPA payment (required) + :type id: int + :param body: (required) + :type body: SEPAPayment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayment", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sepa_payments_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of SEPA payment")], + body: SEPAPayment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update SEPA payment + + + :param id: ID of SEPA payment (required) + :type id: int + :param body: (required) + :type body: SEPAPayment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayment", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sepa_payments_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/sepa-payments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sepa_payments_post( + self, + body: SEPAPayment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SEPAPayment: + """Create SEPA payment + + + :param body: (required) + :type body: SEPAPayment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SEPAPayment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sepa_payments_post_with_http_info( + self, + body: SEPAPayment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SEPAPayment]: + """Create SEPA payment + + + :param body: (required) + :type body: SEPAPayment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SEPAPayment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sepa_payments_post_without_preload_content( + self, + body: SEPAPayment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create SEPA payment + + + :param body: (required) + :type body: SEPAPayment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SEPAPayment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sepa_payments_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sepa-payments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/serial_number_api.py b/generated/async/easybill_generated_async/api/serial_number_api.py new file mode 100644 index 0000000..afe6e40 --- /dev/null +++ b/generated/async/easybill_generated_async/api/serial_number_api.py @@ -0,0 +1,1175 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.serial_number import SerialNumber +from easybill_generated_async.models.serial_numbers import SerialNumbers + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class SerialNumberApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def serial_numbers_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + position_id: Annotated[Optional[StrictStr], Field(description="Filter serial numbers by position id.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter serial numbers by document id.")] = None, + in_use: Annotated[Optional[StrictBool], Field(description="Filter serial numbers by usage.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SerialNumbers: + """Fetch a list of serial numbers for positions + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param position_id: Filter serial numbers by position id. + :type position_id: str + :param document_id: Filter serial numbers by document id. + :type document_id: str + :param in_use: Filter serial numbers by usage. + :type in_use: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_get_serialize( + limit=limit, + page=page, + position_id=position_id, + document_id=document_id, + in_use=in_use, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumbers", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def serial_numbers_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + position_id: Annotated[Optional[StrictStr], Field(description="Filter serial numbers by position id.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter serial numbers by document id.")] = None, + in_use: Annotated[Optional[StrictBool], Field(description="Filter serial numbers by usage.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SerialNumbers]: + """Fetch a list of serial numbers for positions + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param position_id: Filter serial numbers by position id. + :type position_id: str + :param document_id: Filter serial numbers by document id. + :type document_id: str + :param in_use: Filter serial numbers by usage. + :type in_use: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_get_serialize( + limit=limit, + page=page, + position_id=position_id, + document_id=document_id, + in_use=in_use, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumbers", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def serial_numbers_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + position_id: Annotated[Optional[StrictStr], Field(description="Filter serial numbers by position id.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter serial numbers by document id.")] = None, + in_use: Annotated[Optional[StrictBool], Field(description="Filter serial numbers by usage.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch a list of serial numbers for positions + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param position_id: Filter serial numbers by position id. + :type position_id: str + :param document_id: Filter serial numbers by document id. + :type document_id: str + :param in_use: Filter serial numbers by usage. + :type in_use: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_get_serialize( + limit=limit, + page=page, + position_id=position_id, + document_id=document_id, + in_use=in_use, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumbers", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _serial_numbers_get_serialize( + self, + limit, + page, + position_id, + document_id, + in_use, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if position_id is not None: + + _query_params.append(('position_id', position_id)) + + if document_id is not None: + + _query_params.append(('document_id', document_id)) + + if in_use is not None: + + _query_params.append(('in_use', in_use)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/serial-numbers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def serial_numbers_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of the serial number that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a serial number for a position + + + :param id: ID of the serial number that needs to be deleted (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def serial_numbers_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the serial number that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a serial number for a position + + + :param id: ID of the serial number that needs to be deleted (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def serial_numbers_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the serial number that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a serial number for a position + + + :param id: ID of the serial number that needs to be deleted (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _serial_numbers_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/serial-numbers/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def serial_numbers_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of the serial number that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SerialNumber: + """Fetch a serial number for a position + + + :param id: ID of the serial number that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumber", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def serial_numbers_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the serial number that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SerialNumber]: + """Fetch a serial number for a position + + + :param id: ID of the serial number that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumber", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def serial_numbers_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the serial number that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch a serial number for a position + + + :param id: ID of the serial number that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumber", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _serial_numbers_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/serial-numbers/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def serial_numbers_post( + self, + body: Optional[SerialNumber] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SerialNumber: + """Create s serial number for a position + + + :param body: + :type body: SerialNumber + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumber", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def serial_numbers_post_with_http_info( + self, + body: Optional[SerialNumber] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SerialNumber]: + """Create s serial number for a position + + + :param body: + :type body: SerialNumber + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumber", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def serial_numbers_post_without_preload_content( + self, + body: Optional[SerialNumber] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create s serial number for a position + + + :param body: + :type body: SerialNumber + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumber", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _serial_numbers_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/serial-numbers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/stock_api.py b/generated/async/easybill_generated_async/api/stock_api.py new file mode 100644 index 0000000..fde70f8 --- /dev/null +++ b/generated/async/easybill_generated_async/api/stock_api.py @@ -0,0 +1,897 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.stock import Stock +from easybill_generated_async.models.stocks import Stocks + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class StockApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def stocks_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + position_id: Annotated[Optional[StrictStr], Field(description="Filter stock entries by position id.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter stock entries by document id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Stocks: + """Fetch a list of stock entries for positions + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param position_id: Filter stock entries by position id. + :type position_id: str + :param document_id: Filter stock entries by document id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_get_serialize( + limit=limit, + page=page, + position_id=position_id, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Stocks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def stocks_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + position_id: Annotated[Optional[StrictStr], Field(description="Filter stock entries by position id.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter stock entries by document id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Stocks]: + """Fetch a list of stock entries for positions + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param position_id: Filter stock entries by position id. + :type position_id: str + :param document_id: Filter stock entries by document id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_get_serialize( + limit=limit, + page=page, + position_id=position_id, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Stocks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def stocks_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + position_id: Annotated[Optional[StrictStr], Field(description="Filter stock entries by position id.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter stock entries by document id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch a list of stock entries for positions + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param position_id: Filter stock entries by position id. + :type position_id: str + :param document_id: Filter stock entries by document id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_get_serialize( + limit=limit, + page=page, + position_id=position_id, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Stocks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _stocks_get_serialize( + self, + limit, + page, + position_id, + document_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if position_id is not None: + + _query_params.append(('position_id', position_id)) + + if document_id is not None: + + _query_params.append(('document_id', document_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/stocks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def stocks_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of the stock entry that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Stock: + """Fetch an stock entry for a position + + + :param id: ID of the stock entry that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Stock", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def stocks_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the stock entry that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Stock]: + """Fetch an stock entry for a position + + + :param id: ID of the stock entry that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Stock", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def stocks_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the stock entry that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch an stock entry for a position + + + :param id: ID of the stock entry that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Stock", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _stocks_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/stocks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def stocks_post( + self, + body: Stock, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Stock: + """Create a stock entry for a position + + + :param body: (required) + :type body: Stock + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Stock", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def stocks_post_with_http_info( + self, + body: Stock, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Stock]: + """Create a stock entry for a position + + + :param body: (required) + :type body: Stock + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Stock", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def stocks_post_without_preload_content( + self, + body: Stock, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a stock entry for a position + + + :param body: (required) + :type body: Stock + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Stock", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _stocks_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/stocks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/task_api.py b/generated/async/easybill_generated_async/api/task_api.py new file mode 100644 index 0000000..9a615e0 --- /dev/null +++ b/generated/async/easybill_generated_async/api/task_api.py @@ -0,0 +1,1411 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.task import Task +from easybill_generated_async.models.tasks import Tasks + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class TaskApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def tasks_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Tasks: + """Fetch tasks list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Tasks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def tasks_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Tasks]: + """Fetch tasks list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Tasks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def tasks_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch tasks list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Tasks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tasks_get_serialize( + self, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tasks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def tasks_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete task + + + :param id: ID of task (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def tasks_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete task + + + :param id: ID of task (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def tasks_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete task + + + :param id: ID of task (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tasks_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tasks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def tasks_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Task: + """Fetch task + + + :param id: ID of task (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def tasks_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Task]: + """Fetch task + + + :param id: ID of task (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def tasks_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch task + + + :param id: ID of task (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tasks_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tasks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def tasks_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + body: Task, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Task: + """Update task + + + :param id: ID of task (required) + :type id: int + :param body: (required) + :type body: Task + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def tasks_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + body: Task, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Task]: + """Update task + + + :param id: ID of task (required) + :type id: int + :param body: (required) + :type body: Task + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def tasks_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + body: Task, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update task + + + :param id: ID of task (required) + :type id: int + :param body: (required) + :type body: Task + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tasks_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tasks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def tasks_post( + self, + body: Task, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Task: + """Create task + + + :param body: (required) + :type body: Task + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Task", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def tasks_post_with_http_info( + self, + body: Task, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Task]: + """Create task + + + :param body: (required) + :type body: Task + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Task", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def tasks_post_without_preload_content( + self, + body: Task, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create task + + + :param body: (required) + :type body: Task + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Task", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tasks_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tasks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/text_template_api.py b/generated/async/easybill_generated_async/api/text_template_api.py new file mode 100644 index 0000000..19b89f0 --- /dev/null +++ b/generated/async/easybill_generated_async/api/text_template_api.py @@ -0,0 +1,1411 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.text_template import TextTemplate +from easybill_generated_async.models.text_templates import TextTemplates + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class TextTemplateApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def text_templates_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TextTemplates: + """Fetch text templates list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplates", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def text_templates_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TextTemplates]: + """Fetch text templates list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplates", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def text_templates_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch text templates list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplates", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _text_templates_get_serialize( + self, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/text-templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def text_templates_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete text template + + + :param id: ID of text template (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def text_templates_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete text template + + + :param id: ID of text template (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def text_templates_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete text template + + + :param id: ID of text template (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _text_templates_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/text-templates/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def text_templates_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TextTemplate: + """Fetch text template + + + :param id: ID of text template (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplate", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def text_templates_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TextTemplate]: + """Fetch text template + + + :param id: ID of text template (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplate", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def text_templates_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch text template + + + :param id: ID of text template (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplate", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _text_templates_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/text-templates/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def text_templates_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + body: TextTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TextTemplate: + """Update text template + + + :param id: ID of text template (required) + :type id: int + :param body: (required) + :type body: TextTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplate", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def text_templates_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + body: TextTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TextTemplate]: + """Update text template + + + :param id: ID of text template (required) + :type id: int + :param body: (required) + :type body: TextTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplate", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def text_templates_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + body: TextTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update text template + + + :param id: ID of text template (required) + :type id: int + :param body: (required) + :type body: TextTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplate", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _text_templates_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/text-templates/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def text_templates_post( + self, + body: TextTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TextTemplate: + """Create text template + + + :param body: (required) + :type body: TextTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TextTemplate", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def text_templates_post_with_http_info( + self, + body: TextTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TextTemplate]: + """Create text template + + + :param body: (required) + :type body: TextTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TextTemplate", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def text_templates_post_without_preload_content( + self, + body: TextTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create text template + + + :param body: (required) + :type body: TextTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TextTemplate", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _text_templates_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/text-templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/time_tracking_api.py b/generated/async/easybill_generated_async/api/time_tracking_api.py new file mode 100644 index 0000000..624a94f --- /dev/null +++ b/generated/async/easybill_generated_async/api/time_tracking_api.py @@ -0,0 +1,1479 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.time_tracking import TimeTracking +from easybill_generated_async.models.time_trackings import TimeTrackings + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class TimeTrackingApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def time_trackings_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + login_id: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id.")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id.")] = None, + date_from_at: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00.")] = None, + date_thru_at: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TimeTrackings: + """Fetch time trackings list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param login_id: Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id. + :type login_id: str + :param project_id: Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id. + :type project_id: str + :param date_from_at: Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. + :type date_from_at: str + :param date_thru_at: Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. + :type date_thru_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_get_serialize( + limit=limit, + page=page, + login_id=login_id, + project_id=project_id, + date_from_at=date_from_at, + date_thru_at=date_thru_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTrackings", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def time_trackings_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + login_id: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id.")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id.")] = None, + date_from_at: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00.")] = None, + date_thru_at: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TimeTrackings]: + """Fetch time trackings list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param login_id: Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id. + :type login_id: str + :param project_id: Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id. + :type project_id: str + :param date_from_at: Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. + :type date_from_at: str + :param date_thru_at: Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. + :type date_thru_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_get_serialize( + limit=limit, + page=page, + login_id=login_id, + project_id=project_id, + date_from_at=date_from_at, + date_thru_at=date_thru_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTrackings", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def time_trackings_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + login_id: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id.")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id.")] = None, + date_from_at: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00.")] = None, + date_thru_at: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch time trackings list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param login_id: Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id. + :type login_id: str + :param project_id: Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id. + :type project_id: str + :param date_from_at: Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. + :type date_from_at: str + :param date_thru_at: Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. + :type date_thru_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_get_serialize( + limit=limit, + page=page, + login_id=login_id, + project_id=project_id, + date_from_at=date_from_at, + date_thru_at=date_thru_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTrackings", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _time_trackings_get_serialize( + self, + limit, + page, + login_id, + project_id, + date_from_at, + date_thru_at, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if login_id is not None: + + _query_params.append(('login_id', login_id)) + + if project_id is not None: + + _query_params.append(('project_id', project_id)) + + if date_from_at is not None: + + _query_params.append(('date_from_at', date_from_at)) + + if date_thru_at is not None: + + _query_params.append(('date_thru_at', date_thru_at)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/time-trackings', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def time_trackings_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def time_trackings_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def time_trackings_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _time_trackings_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/time-trackings/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def time_trackings_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TimeTracking: + """Fetch time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTracking", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def time_trackings_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TimeTracking]: + """Fetch time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTracking", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def time_trackings_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTracking", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _time_trackings_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/time-trackings/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def time_trackings_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + body: TimeTracking, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TimeTracking: + """Update time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param body: (required) + :type body: TimeTracking + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTracking", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def time_trackings_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + body: TimeTracking, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TimeTracking]: + """Update time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param body: (required) + :type body: TimeTracking + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTracking", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def time_trackings_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + body: TimeTracking, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param body: (required) + :type body: TimeTracking + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTracking", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _time_trackings_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/time-trackings/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def time_trackings_post( + self, + body: TimeTracking, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TimeTracking: + """Create time tracking + + + :param body: (required) + :type body: TimeTracking + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TimeTracking", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def time_trackings_post_with_http_info( + self, + body: TimeTracking, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TimeTracking]: + """Create time tracking + + + :param body: (required) + :type body: TimeTracking + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TimeTracking", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def time_trackings_post_without_preload_content( + self, + body: TimeTracking, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create time tracking + + + :param body: (required) + :type body: TimeTracking + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TimeTracking", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _time_trackings_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/time-trackings', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api/webhook_api.py b/generated/async/easybill_generated_async/api/webhook_api.py new file mode 100644 index 0000000..bca8534 --- /dev/null +++ b/generated/async/easybill_generated_async/api/webhook_api.py @@ -0,0 +1,1411 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_async.models.web_hook import WebHook +from easybill_generated_async.models.web_hooks import WebHooks + +from easybill_generated_async.api_client import ApiClient, RequestSerialized +from easybill_generated_async.api_response import ApiResponse +from easybill_generated_async.rest import RESTResponseType + + +class WebhookApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def webhooks_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebHooks: + """Fetch WebHooks list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHooks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def webhooks_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebHooks]: + """Fetch WebHooks list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHooks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def webhooks_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch WebHooks list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHooks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _webhooks_get_serialize( + self, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/webhooks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def webhooks_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def webhooks_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def webhooks_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _webhooks_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/webhooks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def webhooks_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebHook: + """Fetch WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHook", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def webhooks_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebHook]: + """Fetch WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHook", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def webhooks_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHook", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _webhooks_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/webhooks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def webhooks_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + body: WebHook, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebHook: + """Update WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param body: (required) + :type body: WebHook + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHook", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def webhooks_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + body: WebHook, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebHook]: + """Update WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param body: (required) + :type body: WebHook + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHook", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def webhooks_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + body: WebHook, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param body: (required) + :type body: WebHook + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHook", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _webhooks_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/webhooks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def webhooks_post( + self, + body: WebHook, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebHook: + """Create WebHook + + + :param body: (required) + :type body: WebHook + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebHook", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def webhooks_post_with_http_info( + self, + body: WebHook, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebHook]: + """Create WebHook + + + :param body: (required) + :type body: WebHook + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebHook", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def webhooks_post_without_preload_content( + self, + body: WebHook, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create WebHook + + + :param body: (required) + :type body: WebHook + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebHook", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _webhooks_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/webhooks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/async/easybill_generated_async/api_client.py b/generated/async/easybill_generated_async/api_client.py new file mode 100644 index 0000000..43c41ad --- /dev/null +++ b/generated/async/easybill_generated_async/api_client.py @@ -0,0 +1,811 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + + +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal +import json +import mimetypes +import os +import re +import tempfile +import uuid + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from easybill_generated_async.configuration import Configuration +from easybill_generated_async.api_response import ApiResponse, T as ApiResponseT +import easybill_generated_async.models +from easybill_generated_async import rest +from easybill_generated_async.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'UUID': uuid.UUID, + 'object': object, + } + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.client_side_validation = configuration.client_side_validation + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_value, traceback): + await self.close() + + async def close(self): + await self.rest_client.close() + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None or self.configuration.ignore_operation_servers: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + async def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = await self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type in ("bytearray", "bytes"): + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.headers.get('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.headers, + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, uuid.UUID): + return str(obj) + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() + return self.sanitize_for_serialization(obj_dict) + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. + + :return: deserialized object. + """ + + # fetch data from response object + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(easybill_generated_async.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass is object: + return self.__deserialize_object(data) + elif klass is datetime.date: + return self.__deserialize_date(data) + elif klass is datetime.datetime: + return self.__deserialize_datetime(data) + elif klass is decimal.Decimal: + return decimal.Decimal(data) + elif klass is uuid.UUID: + return uuid.UUID(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, quote(str(value))) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.headers.get("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = os.path.basename(m.group(1)) # Strip any directory traversal + if filename in ("", ".", ".."): # fall back to tmp filename + filename = os.path.basename(path) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/generated/async/easybill_generated_async/api_response.py b/generated/async/easybill_generated_async/api_response.py new file mode 100644 index 0000000..9bc7c11 --- /dev/null +++ b/generated/async/easybill_generated_async/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/generated/async/easybill_generated_async/configuration.py b/generated/async/easybill_generated_async/configuration.py new file mode 100644 index 0000000..d72b3c1 --- /dev/null +++ b/generated/async/easybill_generated_async/configuration.py @@ -0,0 +1,648 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import base64 +import copy +import http.client as httplib +import logging +from logging import FileHandler +import sys +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union +from typing_extensions import NotRequired, Self + + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "Bearer": APIKeyAuthSetting, + "basicAuth": BasicAuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: int | aiohttp_retry.RetryOptionsBase - Retry configuration. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. + :param cert_file: the path to a client certificate file, for mTLS. + :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = easybill_generated_async.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + + Configure API client with HTTP basic authentication: + +conf = easybill_generated_async.Configuration( + username='the-user', + password='the-password', +) + + """ + + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[Union[int, Any]] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + cert_file: Optional[str]=None, + key_file: Optional[str]=None, + verify_ssl: bool=True, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", + *, + debug: Optional[bool] = None, + ) -> None: + """Constructor + """ + self._base_path = "https://api.easybill.de/rest/v1" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("easybill_generated_async") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + self.__debug = False + """Debug switch + """ + + self.verify_ssl = verify_ssl + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ + self.cert_file = cert_file + """client certificate file + """ + self.key_file = key_file + """client key file + """ + self.assert_hostname = assert_hostname + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = tls_server_name + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100 + """This value is passed to the aiohttp to limit simultaneous connections. + None in the constructor is coerced to default 100. + """ + + self.proxy = proxy + """Proxy URL + """ + self.proxy_headers = proxy_headers + """Proxy headers + """ + self.safe_chars_for_path_param = safe_chars_for_path_param + """Safe chars for path_param + """ + self.retries = retries + """Retry configuration + """ + # Enable client side validation + self.client_side_validation = client_side_validation + + self.socket_options = socket_options + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = datetime_format + """datetime format + """ + + self.date_format = date_format + """date format + """ + + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name: str, value: Any) -> None: + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default: Optional[Self]) -> None: + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls) -> Self: + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls) -> Self: + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = cls() + return cls._default + + @property + def logger_file(self) -> Optional[str]: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value: Optional[str]) -> None: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self) -> bool: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value: bool) -> None: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self) -> str: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value: str) -> None: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + return None + + def get_basic_auth_token(self) -> Optional[str]: + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + + return "Basic " + base64.b64encode( + (username + ":" + password).encode('utf-8') + ).decode('utf-8') + + def auth_settings(self)-> AuthSettings: + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth: AuthSettings = {} + if 'Bearer' in self.api_key: + auth['Bearer'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_api_key_with_prefix( + 'Bearer', + ), + } + if self.username is not None and self.password is not None: + auth['basicAuth'] = { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + } + return auth + + def to_debug_report(self) -> str: + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.96.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self) -> List[HostSetting]: + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "https://api.easybill.de/rest/v1", + 'description': "No description provided", + } + ] + + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and variable['enum_values'] \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self) -> str: + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value: str) -> None: + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/generated/async/easybill_generated_async/exceptions.py b/generated/async/easybill_generated_async/exceptions.py new file mode 100644 index 0000000..b356261 --- /dev/null +++ b/generated/async/easybill_generated_async/exceptions.py @@ -0,0 +1,218 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from typing import Any, Optional +from typing_extensions import Self + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.headers + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + if self.data: + error_message += "HTTP response data: {0}\n".format(self.data) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/generated/async/easybill_generated_async/models/__init__.py b/generated/async/easybill_generated_async/models/__init__.py new file mode 100644 index 0000000..cf66e00 --- /dev/null +++ b/generated/async/easybill_generated_async/models/__init__.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +# flake8: noqa +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +# import models into model package +from easybill_generated_async.models.advanced_data_field import AdvancedDataField +from easybill_generated_async.models.attachment import Attachment +from easybill_generated_async.models.attachments import Attachments +from easybill_generated_async.models.contact import Contact +from easybill_generated_async.models.contacts import Contacts +from easybill_generated_async.models.customer import Customer +from easybill_generated_async.models.customer_group import CustomerGroup +from easybill_generated_async.models.customer_groups import CustomerGroups +from easybill_generated_async.models.customer_snapshot import CustomerSnapshot +from easybill_generated_async.models.customers import Customers +from easybill_generated_async.models.discount import Discount +from easybill_generated_async.models.discount_position import DiscountPosition +from easybill_generated_async.models.discount_position_group import DiscountPositionGroup +from easybill_generated_async.models.discount_position_groups import DiscountPositionGroups +from easybill_generated_async.models.discount_positions import DiscountPositions +from easybill_generated_async.models.document import Document +from easybill_generated_async.models.document_address import DocumentAddress +from easybill_generated_async.models.document_payment import DocumentPayment +from easybill_generated_async.models.document_payments import DocumentPayments +from easybill_generated_async.models.document_position import DocumentPosition +from easybill_generated_async.models.document_recurring import DocumentRecurring +from easybill_generated_async.models.document_version import DocumentVersion +from easybill_generated_async.models.document_version_item import DocumentVersionItem +from easybill_generated_async.models.document_versions import DocumentVersions +from easybill_generated_async.models.documents import Documents +from easybill_generated_async.models.file_format_config import FileFormatConfig +from easybill_generated_async.models.list import List +from easybill_generated_async.models.login import Login +from easybill_generated_async.models.login_security import LoginSecurity +from easybill_generated_async.models.logins import Logins +from easybill_generated_async.models.pdf_template import PDFTemplate +from easybill_generated_async.models.pdf_template_settings import PDFTemplateSettings +from easybill_generated_async.models.pdf_template_settings_email import PDFTemplateSettingsEmail +from easybill_generated_async.models.pdf_templates import PDFTemplates +from easybill_generated_async.models.position import Position +from easybill_generated_async.models.position_export_identifier_extended import PositionExportIdentifierExtended +from easybill_generated_async.models.position_group import PositionGroup +from easybill_generated_async.models.position_groups import PositionGroups +from easybill_generated_async.models.positions import Positions +from easybill_generated_async.models.post_box import PostBox +from easybill_generated_async.models.post_box_request import PostBoxRequest +from easybill_generated_async.models.post_boxes import PostBoxes +from easybill_generated_async.models.project import Project +from easybill_generated_async.models.projects import Projects +from easybill_generated_async.models.sepa_payment import SEPAPayment +from easybill_generated_async.models.sepa_payments import SEPAPayments +from easybill_generated_async.models.serial_number import SerialNumber +from easybill_generated_async.models.serial_numbers import SerialNumbers +from easybill_generated_async.models.service_date import ServiceDate +from easybill_generated_async.models.stock import Stock +from easybill_generated_async.models.stocks import Stocks +from easybill_generated_async.models.task import Task +from easybill_generated_async.models.tasks import Tasks +from easybill_generated_async.models.text_template import TextTemplate +from easybill_generated_async.models.text_templates import TextTemplates +from easybill_generated_async.models.time_tracking import TimeTracking +from easybill_generated_async.models.time_trackings import TimeTrackings +from easybill_generated_async.models.web_hook import WebHook +from easybill_generated_async.models.web_hook_last_response import WebHookLastResponse +from easybill_generated_async.models.web_hooks import WebHooks + diff --git a/generated/async/easybill_generated_async/models/advanced_data_field.py b/generated/async/easybill_generated_async/models/advanced_data_field.py new file mode 100644 index 0000000..270d6d6 --- /dev/null +++ b/generated/async/easybill_generated_async/models/advanced_data_field.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AdvancedDataField(BaseModel): + """ + EN16931 Business Term (BT field) for structured invoice data + """ # noqa: E501 + identifier: StrictStr = Field(description="BT field identifier (e.g. 'BT-10' for Buyer reference, 'BT-84' for Payment account identifier)") + value: StrictStr = Field(description="Field value") + __properties: ClassVar[List[str]] = ["identifier", "value"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AdvancedDataField from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AdvancedDataField from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "identifier": obj.get("identifier"), + "value": obj.get("value") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/attachment.py b/generated/async/easybill_generated_async/models/attachment.py new file mode 100644 index 0000000..6d14796 --- /dev/null +++ b/generated/async/easybill_generated_async/models/attachment.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Attachment(BaseModel): + """ + If customer_id, project_id and document_id are null, the attachment has a global context and is accessible from the web ui. Keep in mind only to provide one of the four context. You can't attach a file to several context in one request. A error is thrown if you provide two or more context (i. E. sending customer_id, document_id and project_id in combination). + """ # noqa: E501 + created_at: Optional[date] = None + customer_id: Optional[StrictInt] = None + document_id: Optional[StrictInt] = None + file_name: Optional[StrictStr] = None + id: Optional[StrictInt] = None + project_id: Optional[StrictInt] = None + size: Optional[StrictInt] = Field(default=None, description="In byte") + __properties: ClassVar[List[str]] = ["created_at", "customer_id", "document_id", "file_name", "id", "project_id", "size"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Attachment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "file_name", + "id", + "size", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if customer_id (nullable) is None + # and model_fields_set contains the field + if self.customer_id is None and "customer_id" in self.model_fields_set: + _dict['customer_id'] = None + + # set to None if document_id (nullable) is None + # and model_fields_set contains the field + if self.document_id is None and "document_id" in self.model_fields_set: + _dict['document_id'] = None + + # set to None if project_id (nullable) is None + # and model_fields_set contains the field + if self.project_id is None and "project_id" in self.model_fields_set: + _dict['project_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Attachment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "customer_id": obj.get("customer_id"), + "document_id": obj.get("document_id"), + "file_name": obj.get("file_name"), + "id": obj.get("id"), + "project_id": obj.get("project_id"), + "size": obj.get("size") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/attachments.py b/generated/async/easybill_generated_async/models/attachments.py new file mode 100644 index 0000000..c7317f0 --- /dev/null +++ b/generated/async/easybill_generated_async/models/attachments.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.attachment import Attachment +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Attachments(BaseModel): + """ + Attachments + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Attachment]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Attachments from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Attachments from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Attachment.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/contact.py b/generated/async/easybill_generated_async/models/contact.py new file mode 100644 index 0000000..7f79f4e --- /dev/null +++ b/generated/async/easybill_generated_async/models/contact.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Contact(BaseModel): + """ + Contact + """ # noqa: E501 + city: StrictStr + state: Optional[StrictStr] = None + company_name: Optional[StrictStr] = None + country: Optional[StrictStr] = Field(default=None, description="Two-letter country code") + department: Optional[StrictStr] = 'null' + emails: Optional[List[StrictStr]] = None + fax: Optional[StrictStr] = 'null' + first_name: Optional[StrictStr] = 'null' + id: Optional[StrictInt] = None + last_name: Optional[StrictStr] = 'null' + login_id: Optional[StrictInt] = None + mobile: Optional[StrictStr] = 'null' + note: Optional[StrictStr] = 'null' + personal: Optional[StrictBool] = False + phone_1: Optional[StrictStr] = 'null' + phone_2: Optional[StrictStr] = 'null' + salutation: Optional[StrictInt] = Field(default=None, description="0: empty
1: Herrn
2: Frau
3: Firma
4: Herrn und Frau
5: Eheleute
6: Familie") + street: StrictStr + suffix_1: Optional[StrictStr] = 'null' + suffix_2: Optional[StrictStr] = 'null' + title: Optional[StrictStr] = 'null' + zip_code: Optional[StrictStr] = 'null' + created_at: Optional[StrictStr] = None + updated_at: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["city", "state", "company_name", "country", "department", "emails", "fax", "first_name", "id", "last_name", "login_id", "mobile", "note", "personal", "phone_1", "phone_2", "salutation", "street", "suffix_1", "suffix_2", "title", "zip_code", "created_at", "updated_at"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Contact from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "login_id", + "created_at", + "updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if company_name (nullable) is None + # and model_fields_set contains the field + if self.company_name is None and "company_name" in self.model_fields_set: + _dict['company_name'] = None + + # set to None if department (nullable) is None + # and model_fields_set contains the field + if self.department is None and "department" in self.model_fields_set: + _dict['department'] = None + + # set to None if fax (nullable) is None + # and model_fields_set contains the field + if self.fax is None and "fax" in self.model_fields_set: + _dict['fax'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['first_name'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['last_name'] = None + + # set to None if mobile (nullable) is None + # and model_fields_set contains the field + if self.mobile is None and "mobile" in self.model_fields_set: + _dict['mobile'] = None + + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if phone_1 (nullable) is None + # and model_fields_set contains the field + if self.phone_1 is None and "phone_1" in self.model_fields_set: + _dict['phone_1'] = None + + # set to None if phone_2 (nullable) is None + # and model_fields_set contains the field + if self.phone_2 is None and "phone_2" in self.model_fields_set: + _dict['phone_2'] = None + + # set to None if suffix_1 (nullable) is None + # and model_fields_set contains the field + if self.suffix_1 is None and "suffix_1" in self.model_fields_set: + _dict['suffix_1'] = None + + # set to None if suffix_2 (nullable) is None + # and model_fields_set contains the field + if self.suffix_2 is None and "suffix_2" in self.model_fields_set: + _dict['suffix_2'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + # set to None if zip_code (nullable) is None + # and model_fields_set contains the field + if self.zip_code is None and "zip_code" in self.model_fields_set: + _dict['zip_code'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Contact from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "city": obj.get("city"), + "state": obj.get("state"), + "company_name": obj.get("company_name"), + "country": obj.get("country"), + "department": obj.get("department") if obj.get("department") is not None else 'null', + "emails": obj.get("emails"), + "fax": obj.get("fax") if obj.get("fax") is not None else 'null', + "first_name": obj.get("first_name") if obj.get("first_name") is not None else 'null', + "id": obj.get("id"), + "last_name": obj.get("last_name") if obj.get("last_name") is not None else 'null', + "login_id": obj.get("login_id"), + "mobile": obj.get("mobile") if obj.get("mobile") is not None else 'null', + "note": obj.get("note") if obj.get("note") is not None else 'null', + "personal": obj.get("personal") if obj.get("personal") is not None else False, + "phone_1": obj.get("phone_1") if obj.get("phone_1") is not None else 'null', + "phone_2": obj.get("phone_2") if obj.get("phone_2") is not None else 'null', + "salutation": obj.get("salutation"), + "street": obj.get("street"), + "suffix_1": obj.get("suffix_1") if obj.get("suffix_1") is not None else 'null', + "suffix_2": obj.get("suffix_2") if obj.get("suffix_2") is not None else 'null', + "title": obj.get("title") if obj.get("title") is not None else 'null', + "zip_code": obj.get("zip_code") if obj.get("zip_code") is not None else 'null', + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/contacts.py b/generated/async/easybill_generated_async/models/contacts.py new file mode 100644 index 0000000..a74249c --- /dev/null +++ b/generated/async/easybill_generated_async/models/contacts.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.contact import Contact +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Contacts(BaseModel): + """ + Contacts + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Contact]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Contacts from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Contacts from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Contact.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/customer.py b/generated/async/easybill_generated_async/models/customer.py new file mode 100644 index 0000000..ab1b2ad --- /dev/null +++ b/generated/async/easybill_generated_async/models/customer.py @@ -0,0 +1,577 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Customer(BaseModel): + """ + Customer + """ # noqa: E501 + acquire_options: Optional[StrictInt] = Field(default=None, description="1 = Empfehlung eines anderen Kunden, 2 = Zeitungsanzeige, 3 = Eigene Akquisition, 4 = Mitarbeiter Akquisition, 5 = Google, 6 = Gelbe Seiten, 7 = Kostenlose Internet Plattform, 8 = Bezahlte Internet Plattform") + additional_groups_ids: Optional[List[StrictInt]] = None + bank_account: Optional[StrictStr] = None + bank_account_owner: Optional[StrictStr] = None + bank_bic: Optional[StrictStr] = None + bank_code: Optional[StrictStr] = None + bank_iban: Optional[StrictStr] = None + bank_name: Optional[StrictStr] = None + birth_date: Optional[date] = None + cash_allowance: Optional[Union[Annotated[float, Field(le=1E+2, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = None + cash_allowance_days: Optional[StrictInt] = None + cash_discount: Optional[Union[StrictFloat, StrictInt]] = None + cash_discount_type: Optional[StrictStr] = None + city: Optional[StrictStr] = None + state: Optional[StrictStr] = None + company_name: Optional[StrictStr] + country: Optional[StrictStr] = None + created_at: Optional[date] = None + updated_at: Optional[StrictStr] = None + delivery_title: Optional[StrictStr] = None + delivery_city: Optional[StrictStr] = None + delivery_state: Optional[StrictStr] = None + delivery_company_name: Optional[StrictStr] = None + delivery_country: Optional[StrictStr] = None + delivery_first_name: Optional[StrictStr] = None + delivery_last_name: Optional[StrictStr] = None + delivery_personal: Optional[StrictBool] = None + delivery_salutation: Optional[StrictInt] = Field(default=None, description="0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family") + delivery_street: Optional[StrictStr] = None + delivery_suffix_1: Optional[StrictStr] = None + delivery_suffix_2: Optional[StrictStr] = None + delivery_zip_code: Optional[StrictStr] = None + display_name: Optional[StrictStr] = None + emails: Optional[List[StrictStr]] = None + fax: Optional[StrictStr] = None + first_name: Optional[StrictStr] = None + grace_period: Optional[StrictInt] = Field(default=None, description="will be replaced by its alias due_in_days.") + due_in_days: Optional[StrictInt] = Field(default=None, description="due date in days") + group_id: Optional[StrictInt] = None + id: Optional[StrictInt] = None + info_1: Optional[StrictStr] = None + info_2: Optional[StrictStr] = None + internet: Optional[StrictStr] = None + last_name: Optional[StrictStr] + login_id: Optional[StrictInt] = None + mobile: Optional[StrictStr] = None + note: Optional[StrictStr] = None + number: Optional[StrictStr] = Field(default=None, description="Automatically generated if empty/omitted and when no type in query is provided or the type 'CUSTOMER', 'CUSTOMER,SUPPLIER'") + supplier_number: Optional[StrictStr] = Field(default=None, description="Automatically generated if the type SUPPLIER or 'CUSTOMER,SUPPLIER' is provided as query parameter and the field supplier_number is empty/omitted.") + payment_options: Optional[StrictInt] = Field(default=None, description="1 = Stets pünktliche Zahlung, 2 = überwiegend pünktliche Zahlung, 3 = überwiegend verspätete Zahlung, 5 = Grundsätzlich verspätete Zahlung") + personal: Optional[StrictBool] = False + phone_1: Optional[StrictStr] = None + phone_2: Optional[StrictStr] = None + postbox: Optional[StrictStr] = None + postbox_city: Optional[StrictStr] = None + postbox_state: Optional[StrictStr] = None + postbox_country: Optional[StrictStr] = None + postbox_zip_code: Optional[StrictStr] = None + sale_price_level: Optional[StrictStr] = None + salutation: Optional[StrictInt] = Field(default=None, description="0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family") + sepa_agreement: Optional[StrictStr] = Field(default=None, description="BASIC = SEPA-Basislastschrift, COR1 = SEPA-Basislastschrift COR1 (deprecated use BASIC instead), COMPANY = SEPA-Firmenlastschrift, NULL = Noch kein Mandat erteilt") + sepa_agreement_date: Optional[date] = None + sepa_mandate_reference: Optional[StrictStr] = None + since_date: Optional[date] = None + street: Optional[StrictStr] = None + suffix_1: Optional[StrictStr] = None + suffix_2: Optional[StrictStr] = None + tax_number: Optional[StrictStr] = None + court: Optional[StrictStr] = None + court_registry_number: Optional[StrictStr] = None + tax_options: Optional[StrictStr] = Field(default=None, description="nStb = Nicht steuerbar (Drittland), nStbUstID = Nicht steuerbar (EU mit USt-IdNr.), nStbNoneUstID = Nicht steuerbar (EU ohne USt-IdNr.), revc = Steuerschuldwechsel §13b (Inland), IG = Innergemeinschaftliche Lieferung, AL = Ausfuhrlieferung, sStfr = sonstige Steuerbefreiung, NULL = Umsatzsteuerpflichtig") + title: Optional[StrictStr] = None + archived: Optional[StrictBool] = None + vat_identifier: Optional[StrictStr] = None + zip_code: Optional[StrictStr] = None + document_pdf_type: Optional[StrictStr] = Field(default='default', description="Type of PDF to use when sending a Document to the Customer.") + buyer_reference: Optional[StrictStr] = Field(default=None, description="Used as \"buyerReference\" in ZUGFeRD and as \"Leitweg-ID\" in the XRechnung format.") + foreign_supplier_number: Optional[StrictStr] = Field(default=None, description="The ID given to your company by the customer in his system.") + __properties: ClassVar[List[str]] = ["acquire_options", "additional_groups_ids", "bank_account", "bank_account_owner", "bank_bic", "bank_code", "bank_iban", "bank_name", "birth_date", "cash_allowance", "cash_allowance_days", "cash_discount", "cash_discount_type", "city", "state", "company_name", "country", "created_at", "updated_at", "delivery_title", "delivery_city", "delivery_state", "delivery_company_name", "delivery_country", "delivery_first_name", "delivery_last_name", "delivery_personal", "delivery_salutation", "delivery_street", "delivery_suffix_1", "delivery_suffix_2", "delivery_zip_code", "display_name", "emails", "fax", "first_name", "grace_period", "due_in_days", "group_id", "id", "info_1", "info_2", "internet", "last_name", "login_id", "mobile", "note", "number", "supplier_number", "payment_options", "personal", "phone_1", "phone_2", "postbox", "postbox_city", "postbox_state", "postbox_country", "postbox_zip_code", "sale_price_level", "salutation", "sepa_agreement", "sepa_agreement_date", "sepa_mandate_reference", "since_date", "street", "suffix_1", "suffix_2", "tax_number", "court", "court_registry_number", "tax_options", "title", "archived", "vat_identifier", "zip_code", "document_pdf_type", "buyer_reference", "foreign_supplier_number"] + + @field_validator('cash_discount_type') + def cash_discount_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PERCENT', 'AMOUNT']): + raise ValueError("must be one of enum values ('PERCENT', 'AMOUNT')") + return value + + @field_validator('sale_price_level') + def sale_price_level_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['SALEPRICE2', 'SALEPRICE3', 'SALEPRICE4', 'SALEPRICE5', 'SALEPRICE6', 'SALEPRICE7', 'SALEPRICE8', 'SALEPRICE9', 'SALEPRICE10']): + raise ValueError("must be one of enum values ('SALEPRICE2', 'SALEPRICE3', 'SALEPRICE4', 'SALEPRICE5', 'SALEPRICE6', 'SALEPRICE7', 'SALEPRICE8', 'SALEPRICE9', 'SALEPRICE10')") + return value + + @field_validator('sepa_agreement') + def sepa_agreement_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['BASIC', 'COR1', 'COMPANY', 'NULL']): + raise ValueError("must be one of enum values ('BASIC', 'COR1', 'COMPANY', 'NULL')") + return value + + @field_validator('tax_options') + def tax_options_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['nStb', 'nStbUstID', 'nStbNoneUstID', 'nStbIm', 'revc', 'IG', 'AL', 'sStfr', 'NULL']): + raise ValueError("must be one of enum values ('nStb', 'nStbUstID', 'nStbNoneUstID', 'nStbIm', 'revc', 'IG', 'AL', 'sStfr', 'NULL')") + return value + + @field_validator('document_pdf_type') + def document_pdf_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung2_1_xml', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml']): + raise ValueError("must be one of enum values ('default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung2_1_xml', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Customer from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "updated_at", + "display_name", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if acquire_options (nullable) is None + # and model_fields_set contains the field + if self.acquire_options is None and "acquire_options" in self.model_fields_set: + _dict['acquire_options'] = None + + # set to None if bank_account (nullable) is None + # and model_fields_set contains the field + if self.bank_account is None and "bank_account" in self.model_fields_set: + _dict['bank_account'] = None + + # set to None if bank_account_owner (nullable) is None + # and model_fields_set contains the field + if self.bank_account_owner is None and "bank_account_owner" in self.model_fields_set: + _dict['bank_account_owner'] = None + + # set to None if bank_bic (nullable) is None + # and model_fields_set contains the field + if self.bank_bic is None and "bank_bic" in self.model_fields_set: + _dict['bank_bic'] = None + + # set to None if bank_code (nullable) is None + # and model_fields_set contains the field + if self.bank_code is None and "bank_code" in self.model_fields_set: + _dict['bank_code'] = None + + # set to None if bank_iban (nullable) is None + # and model_fields_set contains the field + if self.bank_iban is None and "bank_iban" in self.model_fields_set: + _dict['bank_iban'] = None + + # set to None if bank_name (nullable) is None + # and model_fields_set contains the field + if self.bank_name is None and "bank_name" in self.model_fields_set: + _dict['bank_name'] = None + + # set to None if birth_date (nullable) is None + # and model_fields_set contains the field + if self.birth_date is None and "birth_date" in self.model_fields_set: + _dict['birth_date'] = None + + # set to None if cash_allowance (nullable) is None + # and model_fields_set contains the field + if self.cash_allowance is None and "cash_allowance" in self.model_fields_set: + _dict['cash_allowance'] = None + + # set to None if cash_discount (nullable) is None + # and model_fields_set contains the field + if self.cash_discount is None and "cash_discount" in self.model_fields_set: + _dict['cash_discount'] = None + + # set to None if cash_discount_type (nullable) is None + # and model_fields_set contains the field + if self.cash_discount_type is None and "cash_discount_type" in self.model_fields_set: + _dict['cash_discount_type'] = None + + # set to None if city (nullable) is None + # and model_fields_set contains the field + if self.city is None and "city" in self.model_fields_set: + _dict['city'] = None + + # set to None if company_name (nullable) is None + # and model_fields_set contains the field + if self.company_name is None and "company_name" in self.model_fields_set: + _dict['company_name'] = None + + # set to None if delivery_city (nullable) is None + # and model_fields_set contains the field + if self.delivery_city is None and "delivery_city" in self.model_fields_set: + _dict['delivery_city'] = None + + # set to None if delivery_company_name (nullable) is None + # and model_fields_set contains the field + if self.delivery_company_name is None and "delivery_company_name" in self.model_fields_set: + _dict['delivery_company_name'] = None + + # set to None if delivery_country (nullable) is None + # and model_fields_set contains the field + if self.delivery_country is None and "delivery_country" in self.model_fields_set: + _dict['delivery_country'] = None + + # set to None if delivery_first_name (nullable) is None + # and model_fields_set contains the field + if self.delivery_first_name is None and "delivery_first_name" in self.model_fields_set: + _dict['delivery_first_name'] = None + + # set to None if delivery_last_name (nullable) is None + # and model_fields_set contains the field + if self.delivery_last_name is None and "delivery_last_name" in self.model_fields_set: + _dict['delivery_last_name'] = None + + # set to None if delivery_street (nullable) is None + # and model_fields_set contains the field + if self.delivery_street is None and "delivery_street" in self.model_fields_set: + _dict['delivery_street'] = None + + # set to None if delivery_suffix_1 (nullable) is None + # and model_fields_set contains the field + if self.delivery_suffix_1 is None and "delivery_suffix_1" in self.model_fields_set: + _dict['delivery_suffix_1'] = None + + # set to None if delivery_suffix_2 (nullable) is None + # and model_fields_set contains the field + if self.delivery_suffix_2 is None and "delivery_suffix_2" in self.model_fields_set: + _dict['delivery_suffix_2'] = None + + # set to None if delivery_zip_code (nullable) is None + # and model_fields_set contains the field + if self.delivery_zip_code is None and "delivery_zip_code" in self.model_fields_set: + _dict['delivery_zip_code'] = None + + # set to None if fax (nullable) is None + # and model_fields_set contains the field + if self.fax is None and "fax" in self.model_fields_set: + _dict['fax'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['first_name'] = None + + # set to None if grace_period (nullable) is None + # and model_fields_set contains the field + if self.grace_period is None and "grace_period" in self.model_fields_set: + _dict['grace_period'] = None + + # set to None if due_in_days (nullable) is None + # and model_fields_set contains the field + if self.due_in_days is None and "due_in_days" in self.model_fields_set: + _dict['due_in_days'] = None + + # set to None if group_id (nullable) is None + # and model_fields_set contains the field + if self.group_id is None and "group_id" in self.model_fields_set: + _dict['group_id'] = None + + # set to None if info_1 (nullable) is None + # and model_fields_set contains the field + if self.info_1 is None and "info_1" in self.model_fields_set: + _dict['info_1'] = None + + # set to None if info_2 (nullable) is None + # and model_fields_set contains the field + if self.info_2 is None and "info_2" in self.model_fields_set: + _dict['info_2'] = None + + # set to None if internet (nullable) is None + # and model_fields_set contains the field + if self.internet is None and "internet" in self.model_fields_set: + _dict['internet'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['last_name'] = None + + # set to None if mobile (nullable) is None + # and model_fields_set contains the field + if self.mobile is None and "mobile" in self.model_fields_set: + _dict['mobile'] = None + + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if payment_options (nullable) is None + # and model_fields_set contains the field + if self.payment_options is None and "payment_options" in self.model_fields_set: + _dict['payment_options'] = None + + # set to None if phone_1 (nullable) is None + # and model_fields_set contains the field + if self.phone_1 is None and "phone_1" in self.model_fields_set: + _dict['phone_1'] = None + + # set to None if phone_2 (nullable) is None + # and model_fields_set contains the field + if self.phone_2 is None and "phone_2" in self.model_fields_set: + _dict['phone_2'] = None + + # set to None if postbox (nullable) is None + # and model_fields_set contains the field + if self.postbox is None and "postbox" in self.model_fields_set: + _dict['postbox'] = None + + # set to None if postbox_city (nullable) is None + # and model_fields_set contains the field + if self.postbox_city is None and "postbox_city" in self.model_fields_set: + _dict['postbox_city'] = None + + # set to None if postbox_country (nullable) is None + # and model_fields_set contains the field + if self.postbox_country is None and "postbox_country" in self.model_fields_set: + _dict['postbox_country'] = None + + # set to None if postbox_zip_code (nullable) is None + # and model_fields_set contains the field + if self.postbox_zip_code is None and "postbox_zip_code" in self.model_fields_set: + _dict['postbox_zip_code'] = None + + # set to None if sale_price_level (nullable) is None + # and model_fields_set contains the field + if self.sale_price_level is None and "sale_price_level" in self.model_fields_set: + _dict['sale_price_level'] = None + + # set to None if sepa_agreement (nullable) is None + # and model_fields_set contains the field + if self.sepa_agreement is None and "sepa_agreement" in self.model_fields_set: + _dict['sepa_agreement'] = None + + # set to None if sepa_agreement_date (nullable) is None + # and model_fields_set contains the field + if self.sepa_agreement_date is None and "sepa_agreement_date" in self.model_fields_set: + _dict['sepa_agreement_date'] = None + + # set to None if sepa_mandate_reference (nullable) is None + # and model_fields_set contains the field + if self.sepa_mandate_reference is None and "sepa_mandate_reference" in self.model_fields_set: + _dict['sepa_mandate_reference'] = None + + # set to None if since_date (nullable) is None + # and model_fields_set contains the field + if self.since_date is None and "since_date" in self.model_fields_set: + _dict['since_date'] = None + + # set to None if street (nullable) is None + # and model_fields_set contains the field + if self.street is None and "street" in self.model_fields_set: + _dict['street'] = None + + # set to None if suffix_1 (nullable) is None + # and model_fields_set contains the field + if self.suffix_1 is None and "suffix_1" in self.model_fields_set: + _dict['suffix_1'] = None + + # set to None if suffix_2 (nullable) is None + # and model_fields_set contains the field + if self.suffix_2 is None and "suffix_2" in self.model_fields_set: + _dict['suffix_2'] = None + + # set to None if tax_number (nullable) is None + # and model_fields_set contains the field + if self.tax_number is None and "tax_number" in self.model_fields_set: + _dict['tax_number'] = None + + # set to None if court (nullable) is None + # and model_fields_set contains the field + if self.court is None and "court" in self.model_fields_set: + _dict['court'] = None + + # set to None if court_registry_number (nullable) is None + # and model_fields_set contains the field + if self.court_registry_number is None and "court_registry_number" in self.model_fields_set: + _dict['court_registry_number'] = None + + # set to None if tax_options (nullable) is None + # and model_fields_set contains the field + if self.tax_options is None and "tax_options" in self.model_fields_set: + _dict['tax_options'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + # set to None if vat_identifier (nullable) is None + # and model_fields_set contains the field + if self.vat_identifier is None and "vat_identifier" in self.model_fields_set: + _dict['vat_identifier'] = None + + # set to None if zip_code (nullable) is None + # and model_fields_set contains the field + if self.zip_code is None and "zip_code" in self.model_fields_set: + _dict['zip_code'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Customer from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "acquire_options": obj.get("acquire_options"), + "additional_groups_ids": obj.get("additional_groups_ids"), + "bank_account": obj.get("bank_account"), + "bank_account_owner": obj.get("bank_account_owner"), + "bank_bic": obj.get("bank_bic"), + "bank_code": obj.get("bank_code"), + "bank_iban": obj.get("bank_iban"), + "bank_name": obj.get("bank_name"), + "birth_date": obj.get("birth_date"), + "cash_allowance": obj.get("cash_allowance"), + "cash_allowance_days": obj.get("cash_allowance_days"), + "cash_discount": obj.get("cash_discount"), + "cash_discount_type": obj.get("cash_discount_type"), + "city": obj.get("city"), + "state": obj.get("state"), + "company_name": obj.get("company_name"), + "country": obj.get("country"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "delivery_title": obj.get("delivery_title"), + "delivery_city": obj.get("delivery_city"), + "delivery_state": obj.get("delivery_state"), + "delivery_company_name": obj.get("delivery_company_name"), + "delivery_country": obj.get("delivery_country"), + "delivery_first_name": obj.get("delivery_first_name"), + "delivery_last_name": obj.get("delivery_last_name"), + "delivery_personal": obj.get("delivery_personal"), + "delivery_salutation": obj.get("delivery_salutation"), + "delivery_street": obj.get("delivery_street"), + "delivery_suffix_1": obj.get("delivery_suffix_1"), + "delivery_suffix_2": obj.get("delivery_suffix_2"), + "delivery_zip_code": obj.get("delivery_zip_code"), + "display_name": obj.get("display_name"), + "emails": obj.get("emails"), + "fax": obj.get("fax"), + "first_name": obj.get("first_name"), + "grace_period": obj.get("grace_period"), + "due_in_days": obj.get("due_in_days"), + "group_id": obj.get("group_id"), + "id": obj.get("id"), + "info_1": obj.get("info_1"), + "info_2": obj.get("info_2"), + "internet": obj.get("internet"), + "last_name": obj.get("last_name"), + "login_id": obj.get("login_id"), + "mobile": obj.get("mobile"), + "note": obj.get("note"), + "number": obj.get("number"), + "supplier_number": obj.get("supplier_number"), + "payment_options": obj.get("payment_options"), + "personal": obj.get("personal") if obj.get("personal") is not None else False, + "phone_1": obj.get("phone_1"), + "phone_2": obj.get("phone_2"), + "postbox": obj.get("postbox"), + "postbox_city": obj.get("postbox_city"), + "postbox_state": obj.get("postbox_state"), + "postbox_country": obj.get("postbox_country"), + "postbox_zip_code": obj.get("postbox_zip_code"), + "sale_price_level": obj.get("sale_price_level"), + "salutation": obj.get("salutation"), + "sepa_agreement": obj.get("sepa_agreement"), + "sepa_agreement_date": obj.get("sepa_agreement_date"), + "sepa_mandate_reference": obj.get("sepa_mandate_reference"), + "since_date": obj.get("since_date"), + "street": obj.get("street"), + "suffix_1": obj.get("suffix_1"), + "suffix_2": obj.get("suffix_2"), + "tax_number": obj.get("tax_number"), + "court": obj.get("court"), + "court_registry_number": obj.get("court_registry_number"), + "tax_options": obj.get("tax_options"), + "title": obj.get("title"), + "archived": obj.get("archived"), + "vat_identifier": obj.get("vat_identifier"), + "zip_code": obj.get("zip_code"), + "document_pdf_type": obj.get("document_pdf_type") if obj.get("document_pdf_type") is not None else 'default', + "buyer_reference": obj.get("buyer_reference"), + "foreign_supplier_number": obj.get("foreign_supplier_number") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/customer_group.py b/generated/async/easybill_generated_async/models/customer_group.py new file mode 100644 index 0000000..be07285 --- /dev/null +++ b/generated/async/easybill_generated_async/models/customer_group.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CustomerGroup(BaseModel): + """ + CustomerGroup + """ # noqa: E501 + name: StrictStr + description: Optional[StrictStr] = 'null' + number: StrictStr = Field(description="Can be chosen freely") + display_name: Optional[StrictStr] = None + id: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["name", "description", "number", "display_name", "id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CustomerGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "display_name", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CustomerGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "description": obj.get("description") if obj.get("description") is not None else 'null', + "number": obj.get("number"), + "display_name": obj.get("display_name"), + "id": obj.get("id") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/customer_groups.py b/generated/async/easybill_generated_async/models/customer_groups.py new file mode 100644 index 0000000..5a3ee50 --- /dev/null +++ b/generated/async/easybill_generated_async/models/customer_groups.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.customer_group import CustomerGroup +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CustomerGroups(BaseModel): + """ + CustomerGroups + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[CustomerGroup]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CustomerGroups from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CustomerGroups from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [CustomerGroup.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/customer_snapshot.py b/generated/async/easybill_generated_async/models/customer_snapshot.py new file mode 100644 index 0000000..61f7bfd --- /dev/null +++ b/generated/async/easybill_generated_async/models/customer_snapshot.py @@ -0,0 +1,577 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CustomerSnapshot(BaseModel): + """ + A snapshot of the customer model which belongs to a document. This model is readonly and the state is final after finalization of the document. It's is identical to the state of the customer model at the time of finalization. Updates to the actual customer dataset won't affect this snapshot, however if you update the document the customer and therefore the customer snapshot may reflect a different state. + """ # noqa: E501 + acquire_options: Optional[StrictInt] = Field(default=None, description="1 = Empfehlung eines anderen Kunden, 2 = Zeitungsanzeige, 3 = Eigene Akquisition, 4 = Mitarbeiter Akquisition, 5 = Google, 6 = Gelbe Seiten, 7 = Kostenlose Internet Plattform, 8 = Bezahlte Internet Plattform") + additional_groups_ids: Optional[List[StrictInt]] = None + bank_account: Optional[StrictStr] = None + bank_account_owner: Optional[StrictStr] = None + bank_bic: Optional[StrictStr] = None + bank_code: Optional[StrictStr] = None + bank_iban: Optional[StrictStr] = None + bank_name: Optional[StrictStr] = None + birth_date: Optional[date] = None + cash_allowance: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = None + cash_allowance_days: Optional[StrictInt] = None + cash_discount: Optional[Union[StrictFloat, StrictInt]] = None + cash_discount_type: Optional[StrictStr] = None + city: Optional[StrictStr] = None + state: Optional[StrictStr] = None + company_name: Optional[StrictStr] + country: Optional[StrictStr] = None + created_at: Optional[date] = None + updated_at: Optional[StrictStr] = None + delivery_title: Optional[StrictStr] = None + delivery_city: Optional[StrictStr] = None + delivery_state: Optional[StrictStr] = None + delivery_company_name: Optional[StrictStr] = None + delivery_country: Optional[StrictStr] = None + delivery_first_name: Optional[StrictStr] = None + delivery_last_name: Optional[StrictStr] = None + delivery_personal: Optional[StrictBool] = None + delivery_salutation: Optional[StrictInt] = Field(default=None, description="0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family") + delivery_street: Optional[StrictStr] = None + delivery_suffix_1: Optional[StrictStr] = None + delivery_suffix_2: Optional[StrictStr] = None + delivery_zip_code: Optional[StrictStr] = None + display_name: Optional[StrictStr] = None + emails: Optional[List[StrictStr]] = None + fax: Optional[StrictStr] = None + first_name: Optional[StrictStr] = None + grace_period: Optional[StrictInt] = Field(default=None, description="will be replaced by its alias due_in_days.") + due_in_days: Optional[StrictInt] = Field(default=None, description="due date in days") + group_id: Optional[StrictInt] = None + id: Optional[StrictInt] = None + info_1: Optional[StrictStr] = None + info_2: Optional[StrictStr] = None + internet: Optional[StrictStr] = None + last_name: Optional[StrictStr] + login_id: Optional[StrictInt] = None + mobile: Optional[StrictStr] = None + note: Optional[StrictStr] = None + number: Optional[StrictStr] = Field(default=None, description="Automatically generated if empty/omitted and when no type in query is provided or the type 'CUSTOMER', 'CUSTOMER,SUPPLIER'") + supplier_number: Optional[StrictStr] = Field(default=None, description="Automatically generated if the type SUPPLIER or 'CUSTOMER,SUPPLIER' is provided as query parameter and the field supplier_number is empty/omitted.") + payment_options: Optional[StrictInt] = Field(default=None, description="1 = Stets pünktliche Zahlung, 2 = überwiegend pünktliche Zahlung, 3 = überwiegend verspätete Zahlung, 5 = Grundsätzlich verspätete Zahlung") + personal: Optional[StrictBool] = False + phone_1: Optional[StrictStr] = None + phone_2: Optional[StrictStr] = None + postbox: Optional[StrictStr] = None + postbox_city: Optional[StrictStr] = None + postbox_state: Optional[StrictStr] = None + postbox_country: Optional[StrictStr] = None + postbox_zip_code: Optional[StrictStr] = None + sale_price_level: Optional[StrictStr] = None + salutation: Optional[StrictInt] = Field(default=None, description="0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family") + sepa_agreement: Optional[StrictStr] = Field(default=None, description="BASIC = SEPA-Basislastschrift, COR1 = SEPA-Basislastschrift COR1 (deprecated use BASIC instead), COMPANY = SEPA-Firmenlastschrift, NULL = Noch kein Mandat erteilt") + sepa_agreement_date: Optional[date] = None + sepa_mandate_reference: Optional[StrictStr] = None + since_date: Optional[date] = None + street: Optional[StrictStr] = None + suffix_1: Optional[StrictStr] = None + suffix_2: Optional[StrictStr] = None + tax_number: Optional[StrictStr] = None + court: Optional[StrictStr] = None + court_registry_number: Optional[StrictStr] = None + tax_options: Optional[StrictStr] = Field(default=None, description="nStb = Nicht steuerbar (Drittland), nStbUstID = Nicht steuerbar (EU mit USt-IdNr.), nStbNoneUstID = Nicht steuerbar (EU ohne USt-IdNr.), revc = Steuerschuldwechsel §13b (Inland), IG = Innergemeinschaftliche Lieferung, AL = Ausfuhrlieferung, sStfr = sonstige Steuerbefreiung, NULL = Umsatzsteuerpflichtig") + title: Optional[StrictStr] = None + archived: Optional[StrictBool] = None + vat_identifier: Optional[StrictStr] = None + zip_code: Optional[StrictStr] = None + document_pdf_type: Optional[StrictStr] = Field(default='default', description="Type of PDF to use when sending a Document to the Customer.") + buyer_reference: Optional[StrictStr] = Field(default=None, description="Used as \"buyerReference\" in ZUGFeRD and as \"Leitweg-ID\" in the XRechnung format.") + foreign_supplier_number: Optional[StrictStr] = Field(default=None, description="The ID given to your company by the customer in his system.") + __properties: ClassVar[List[str]] = ["acquire_options", "additional_groups_ids", "bank_account", "bank_account_owner", "bank_bic", "bank_code", "bank_iban", "bank_name", "birth_date", "cash_allowance", "cash_allowance_days", "cash_discount", "cash_discount_type", "city", "state", "company_name", "country", "created_at", "updated_at", "delivery_title", "delivery_city", "delivery_state", "delivery_company_name", "delivery_country", "delivery_first_name", "delivery_last_name", "delivery_personal", "delivery_salutation", "delivery_street", "delivery_suffix_1", "delivery_suffix_2", "delivery_zip_code", "display_name", "emails", "fax", "first_name", "grace_period", "due_in_days", "group_id", "id", "info_1", "info_2", "internet", "last_name", "login_id", "mobile", "note", "number", "supplier_number", "payment_options", "personal", "phone_1", "phone_2", "postbox", "postbox_city", "postbox_state", "postbox_country", "postbox_zip_code", "sale_price_level", "salutation", "sepa_agreement", "sepa_agreement_date", "sepa_mandate_reference", "since_date", "street", "suffix_1", "suffix_2", "tax_number", "court", "court_registry_number", "tax_options", "title", "archived", "vat_identifier", "zip_code", "document_pdf_type", "buyer_reference", "foreign_supplier_number"] + + @field_validator('cash_discount_type') + def cash_discount_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PERCENT', 'AMOUNT']): + raise ValueError("must be one of enum values ('PERCENT', 'AMOUNT')") + return value + + @field_validator('sale_price_level') + def sale_price_level_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['SALEPRICE2', 'SALEPRICE3', 'SALEPRICE4', 'SALEPRICE5', 'SALEPRICE6', 'SALEPRICE7', 'SALEPRICE8', 'SALEPRICE9', 'SALEPRICE10']): + raise ValueError("must be one of enum values ('SALEPRICE2', 'SALEPRICE3', 'SALEPRICE4', 'SALEPRICE5', 'SALEPRICE6', 'SALEPRICE7', 'SALEPRICE8', 'SALEPRICE9', 'SALEPRICE10')") + return value + + @field_validator('sepa_agreement') + def sepa_agreement_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['BASIC', 'COR1', 'COMPANY', 'NULL']): + raise ValueError("must be one of enum values ('BASIC', 'COR1', 'COMPANY', 'NULL')") + return value + + @field_validator('tax_options') + def tax_options_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['nStb', 'nStbUstID', 'nStbNoneUstID', 'nStbIm', 'revc', 'IG', 'AL', 'sStfr', 'NULL']): + raise ValueError("must be one of enum values ('nStb', 'nStbUstID', 'nStbNoneUstID', 'nStbIm', 'revc', 'IG', 'AL', 'sStfr', 'NULL')") + return value + + @field_validator('document_pdf_type') + def document_pdf_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung2_1_xml', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml']): + raise ValueError("must be one of enum values ('default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung2_1_xml', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CustomerSnapshot from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "updated_at", + "display_name", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if acquire_options (nullable) is None + # and model_fields_set contains the field + if self.acquire_options is None and "acquire_options" in self.model_fields_set: + _dict['acquire_options'] = None + + # set to None if bank_account (nullable) is None + # and model_fields_set contains the field + if self.bank_account is None and "bank_account" in self.model_fields_set: + _dict['bank_account'] = None + + # set to None if bank_account_owner (nullable) is None + # and model_fields_set contains the field + if self.bank_account_owner is None and "bank_account_owner" in self.model_fields_set: + _dict['bank_account_owner'] = None + + # set to None if bank_bic (nullable) is None + # and model_fields_set contains the field + if self.bank_bic is None and "bank_bic" in self.model_fields_set: + _dict['bank_bic'] = None + + # set to None if bank_code (nullable) is None + # and model_fields_set contains the field + if self.bank_code is None and "bank_code" in self.model_fields_set: + _dict['bank_code'] = None + + # set to None if bank_iban (nullable) is None + # and model_fields_set contains the field + if self.bank_iban is None and "bank_iban" in self.model_fields_set: + _dict['bank_iban'] = None + + # set to None if bank_name (nullable) is None + # and model_fields_set contains the field + if self.bank_name is None and "bank_name" in self.model_fields_set: + _dict['bank_name'] = None + + # set to None if birth_date (nullable) is None + # and model_fields_set contains the field + if self.birth_date is None and "birth_date" in self.model_fields_set: + _dict['birth_date'] = None + + # set to None if cash_allowance (nullable) is None + # and model_fields_set contains the field + if self.cash_allowance is None and "cash_allowance" in self.model_fields_set: + _dict['cash_allowance'] = None + + # set to None if cash_discount (nullable) is None + # and model_fields_set contains the field + if self.cash_discount is None and "cash_discount" in self.model_fields_set: + _dict['cash_discount'] = None + + # set to None if cash_discount_type (nullable) is None + # and model_fields_set contains the field + if self.cash_discount_type is None and "cash_discount_type" in self.model_fields_set: + _dict['cash_discount_type'] = None + + # set to None if city (nullable) is None + # and model_fields_set contains the field + if self.city is None and "city" in self.model_fields_set: + _dict['city'] = None + + # set to None if company_name (nullable) is None + # and model_fields_set contains the field + if self.company_name is None and "company_name" in self.model_fields_set: + _dict['company_name'] = None + + # set to None if delivery_city (nullable) is None + # and model_fields_set contains the field + if self.delivery_city is None and "delivery_city" in self.model_fields_set: + _dict['delivery_city'] = None + + # set to None if delivery_company_name (nullable) is None + # and model_fields_set contains the field + if self.delivery_company_name is None and "delivery_company_name" in self.model_fields_set: + _dict['delivery_company_name'] = None + + # set to None if delivery_country (nullable) is None + # and model_fields_set contains the field + if self.delivery_country is None and "delivery_country" in self.model_fields_set: + _dict['delivery_country'] = None + + # set to None if delivery_first_name (nullable) is None + # and model_fields_set contains the field + if self.delivery_first_name is None and "delivery_first_name" in self.model_fields_set: + _dict['delivery_first_name'] = None + + # set to None if delivery_last_name (nullable) is None + # and model_fields_set contains the field + if self.delivery_last_name is None and "delivery_last_name" in self.model_fields_set: + _dict['delivery_last_name'] = None + + # set to None if delivery_street (nullable) is None + # and model_fields_set contains the field + if self.delivery_street is None and "delivery_street" in self.model_fields_set: + _dict['delivery_street'] = None + + # set to None if delivery_suffix_1 (nullable) is None + # and model_fields_set contains the field + if self.delivery_suffix_1 is None and "delivery_suffix_1" in self.model_fields_set: + _dict['delivery_suffix_1'] = None + + # set to None if delivery_suffix_2 (nullable) is None + # and model_fields_set contains the field + if self.delivery_suffix_2 is None and "delivery_suffix_2" in self.model_fields_set: + _dict['delivery_suffix_2'] = None + + # set to None if delivery_zip_code (nullable) is None + # and model_fields_set contains the field + if self.delivery_zip_code is None and "delivery_zip_code" in self.model_fields_set: + _dict['delivery_zip_code'] = None + + # set to None if fax (nullable) is None + # and model_fields_set contains the field + if self.fax is None and "fax" in self.model_fields_set: + _dict['fax'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['first_name'] = None + + # set to None if grace_period (nullable) is None + # and model_fields_set contains the field + if self.grace_period is None and "grace_period" in self.model_fields_set: + _dict['grace_period'] = None + + # set to None if due_in_days (nullable) is None + # and model_fields_set contains the field + if self.due_in_days is None and "due_in_days" in self.model_fields_set: + _dict['due_in_days'] = None + + # set to None if group_id (nullable) is None + # and model_fields_set contains the field + if self.group_id is None and "group_id" in self.model_fields_set: + _dict['group_id'] = None + + # set to None if info_1 (nullable) is None + # and model_fields_set contains the field + if self.info_1 is None and "info_1" in self.model_fields_set: + _dict['info_1'] = None + + # set to None if info_2 (nullable) is None + # and model_fields_set contains the field + if self.info_2 is None and "info_2" in self.model_fields_set: + _dict['info_2'] = None + + # set to None if internet (nullable) is None + # and model_fields_set contains the field + if self.internet is None and "internet" in self.model_fields_set: + _dict['internet'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['last_name'] = None + + # set to None if mobile (nullable) is None + # and model_fields_set contains the field + if self.mobile is None and "mobile" in self.model_fields_set: + _dict['mobile'] = None + + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if payment_options (nullable) is None + # and model_fields_set contains the field + if self.payment_options is None and "payment_options" in self.model_fields_set: + _dict['payment_options'] = None + + # set to None if phone_1 (nullable) is None + # and model_fields_set contains the field + if self.phone_1 is None and "phone_1" in self.model_fields_set: + _dict['phone_1'] = None + + # set to None if phone_2 (nullable) is None + # and model_fields_set contains the field + if self.phone_2 is None and "phone_2" in self.model_fields_set: + _dict['phone_2'] = None + + # set to None if postbox (nullable) is None + # and model_fields_set contains the field + if self.postbox is None and "postbox" in self.model_fields_set: + _dict['postbox'] = None + + # set to None if postbox_city (nullable) is None + # and model_fields_set contains the field + if self.postbox_city is None and "postbox_city" in self.model_fields_set: + _dict['postbox_city'] = None + + # set to None if postbox_country (nullable) is None + # and model_fields_set contains the field + if self.postbox_country is None and "postbox_country" in self.model_fields_set: + _dict['postbox_country'] = None + + # set to None if postbox_zip_code (nullable) is None + # and model_fields_set contains the field + if self.postbox_zip_code is None and "postbox_zip_code" in self.model_fields_set: + _dict['postbox_zip_code'] = None + + # set to None if sale_price_level (nullable) is None + # and model_fields_set contains the field + if self.sale_price_level is None and "sale_price_level" in self.model_fields_set: + _dict['sale_price_level'] = None + + # set to None if sepa_agreement (nullable) is None + # and model_fields_set contains the field + if self.sepa_agreement is None and "sepa_agreement" in self.model_fields_set: + _dict['sepa_agreement'] = None + + # set to None if sepa_agreement_date (nullable) is None + # and model_fields_set contains the field + if self.sepa_agreement_date is None and "sepa_agreement_date" in self.model_fields_set: + _dict['sepa_agreement_date'] = None + + # set to None if sepa_mandate_reference (nullable) is None + # and model_fields_set contains the field + if self.sepa_mandate_reference is None and "sepa_mandate_reference" in self.model_fields_set: + _dict['sepa_mandate_reference'] = None + + # set to None if since_date (nullable) is None + # and model_fields_set contains the field + if self.since_date is None and "since_date" in self.model_fields_set: + _dict['since_date'] = None + + # set to None if street (nullable) is None + # and model_fields_set contains the field + if self.street is None and "street" in self.model_fields_set: + _dict['street'] = None + + # set to None if suffix_1 (nullable) is None + # and model_fields_set contains the field + if self.suffix_1 is None and "suffix_1" in self.model_fields_set: + _dict['suffix_1'] = None + + # set to None if suffix_2 (nullable) is None + # and model_fields_set contains the field + if self.suffix_2 is None and "suffix_2" in self.model_fields_set: + _dict['suffix_2'] = None + + # set to None if tax_number (nullable) is None + # and model_fields_set contains the field + if self.tax_number is None and "tax_number" in self.model_fields_set: + _dict['tax_number'] = None + + # set to None if court (nullable) is None + # and model_fields_set contains the field + if self.court is None and "court" in self.model_fields_set: + _dict['court'] = None + + # set to None if court_registry_number (nullable) is None + # and model_fields_set contains the field + if self.court_registry_number is None and "court_registry_number" in self.model_fields_set: + _dict['court_registry_number'] = None + + # set to None if tax_options (nullable) is None + # and model_fields_set contains the field + if self.tax_options is None and "tax_options" in self.model_fields_set: + _dict['tax_options'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + # set to None if vat_identifier (nullable) is None + # and model_fields_set contains the field + if self.vat_identifier is None and "vat_identifier" in self.model_fields_set: + _dict['vat_identifier'] = None + + # set to None if zip_code (nullable) is None + # and model_fields_set contains the field + if self.zip_code is None and "zip_code" in self.model_fields_set: + _dict['zip_code'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CustomerSnapshot from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "acquire_options": obj.get("acquire_options"), + "additional_groups_ids": obj.get("additional_groups_ids"), + "bank_account": obj.get("bank_account"), + "bank_account_owner": obj.get("bank_account_owner"), + "bank_bic": obj.get("bank_bic"), + "bank_code": obj.get("bank_code"), + "bank_iban": obj.get("bank_iban"), + "bank_name": obj.get("bank_name"), + "birth_date": obj.get("birth_date"), + "cash_allowance": obj.get("cash_allowance"), + "cash_allowance_days": obj.get("cash_allowance_days"), + "cash_discount": obj.get("cash_discount"), + "cash_discount_type": obj.get("cash_discount_type"), + "city": obj.get("city"), + "state": obj.get("state"), + "company_name": obj.get("company_name"), + "country": obj.get("country"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "delivery_title": obj.get("delivery_title"), + "delivery_city": obj.get("delivery_city"), + "delivery_state": obj.get("delivery_state"), + "delivery_company_name": obj.get("delivery_company_name"), + "delivery_country": obj.get("delivery_country"), + "delivery_first_name": obj.get("delivery_first_name"), + "delivery_last_name": obj.get("delivery_last_name"), + "delivery_personal": obj.get("delivery_personal"), + "delivery_salutation": obj.get("delivery_salutation"), + "delivery_street": obj.get("delivery_street"), + "delivery_suffix_1": obj.get("delivery_suffix_1"), + "delivery_suffix_2": obj.get("delivery_suffix_2"), + "delivery_zip_code": obj.get("delivery_zip_code"), + "display_name": obj.get("display_name"), + "emails": obj.get("emails"), + "fax": obj.get("fax"), + "first_name": obj.get("first_name"), + "grace_period": obj.get("grace_period"), + "due_in_days": obj.get("due_in_days"), + "group_id": obj.get("group_id"), + "id": obj.get("id"), + "info_1": obj.get("info_1"), + "info_2": obj.get("info_2"), + "internet": obj.get("internet"), + "last_name": obj.get("last_name"), + "login_id": obj.get("login_id"), + "mobile": obj.get("mobile"), + "note": obj.get("note"), + "number": obj.get("number"), + "supplier_number": obj.get("supplier_number"), + "payment_options": obj.get("payment_options"), + "personal": obj.get("personal") if obj.get("personal") is not None else False, + "phone_1": obj.get("phone_1"), + "phone_2": obj.get("phone_2"), + "postbox": obj.get("postbox"), + "postbox_city": obj.get("postbox_city"), + "postbox_state": obj.get("postbox_state"), + "postbox_country": obj.get("postbox_country"), + "postbox_zip_code": obj.get("postbox_zip_code"), + "sale_price_level": obj.get("sale_price_level"), + "salutation": obj.get("salutation"), + "sepa_agreement": obj.get("sepa_agreement"), + "sepa_agreement_date": obj.get("sepa_agreement_date"), + "sepa_mandate_reference": obj.get("sepa_mandate_reference"), + "since_date": obj.get("since_date"), + "street": obj.get("street"), + "suffix_1": obj.get("suffix_1"), + "suffix_2": obj.get("suffix_2"), + "tax_number": obj.get("tax_number"), + "court": obj.get("court"), + "court_registry_number": obj.get("court_registry_number"), + "tax_options": obj.get("tax_options"), + "title": obj.get("title"), + "archived": obj.get("archived"), + "vat_identifier": obj.get("vat_identifier"), + "zip_code": obj.get("zip_code"), + "document_pdf_type": obj.get("document_pdf_type") if obj.get("document_pdf_type") is not None else 'default', + "buyer_reference": obj.get("buyer_reference"), + "foreign_supplier_number": obj.get("foreign_supplier_number") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/customers.py b/generated/async/easybill_generated_async/models/customers.py new file mode 100644 index 0000000..f4ba33c --- /dev/null +++ b/generated/async/easybill_generated_async/models/customers.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.customer import Customer +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Customers(BaseModel): + """ + Customers + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Customer]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Customers from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Customers from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Customer.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/discount.py b/generated/async/easybill_generated_async/models/discount.py new file mode 100644 index 0000000..0a1f9e1 --- /dev/null +++ b/generated/async/easybill_generated_async/models/discount.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Discount(BaseModel): + """ + Discount + """ # noqa: E501 + id: Optional[StrictInt] = None + customer_id: StrictInt + discount: Optional[StrictInt] = Field(default=None, description="The discount value depending on \"discount_type\". If not provided, inherits from customer when available") + discount_type: Optional[StrictStr] = Field(default='PERCENT', description="AMOUNT subtracts the value in \"discount\" from the total
QUANTITY subtracts the value in \"discount\" multiplied by quantity
PERCENT uses the value in \"discount\" as a percentage
FIX sets the value in \"discount\" as the new price. If not provided, inherits from customer when available") + __properties: ClassVar[List[str]] = ["id", "customer_id", "discount", "discount_type"] + + @field_validator('discount_type') + def discount_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AMOUNT', 'PERCENT', 'QUANTITY', 'FIX']): + raise ValueError("must be one of enum values ('AMOUNT', 'PERCENT', 'QUANTITY', 'FIX')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Discount from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Discount from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "customer_id": obj.get("customer_id"), + "discount": obj.get("discount"), + "discount_type": obj.get("discount_type") if obj.get("discount_type") is not None else 'PERCENT' + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/discount_position.py b/generated/async/easybill_generated_async/models/discount_position.py new file mode 100644 index 0000000..171c095 --- /dev/null +++ b/generated/async/easybill_generated_async/models/discount_position.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DiscountPosition(BaseModel): + """ + DiscountPosition + """ # noqa: E501 + id: Optional[StrictInt] = None + customer_id: StrictInt + discount: Optional[StrictInt] = Field(default=None, description="The discount value depending on \"discount_type\". If not provided, inherits from customer when available") + discount_type: Optional[StrictStr] = Field(default='PERCENT', description="AMOUNT subtracts the value in \"discount\" from the total
QUANTITY subtracts the value in \"discount\" multiplied by quantity
PERCENT uses the value in \"discount\" as a percentage
FIX sets the value in \"discount\" as the new price. If not provided, inherits from customer when available") + position_id: StrictInt + __properties: ClassVar[List[str]] = ["id", "customer_id", "discount", "discount_type", "position_id"] + + @field_validator('discount_type') + def discount_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AMOUNT', 'PERCENT', 'QUANTITY', 'FIX']): + raise ValueError("must be one of enum values ('AMOUNT', 'PERCENT', 'QUANTITY', 'FIX')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscountPosition from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiscountPosition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "customer_id": obj.get("customer_id"), + "discount": obj.get("discount"), + "discount_type": obj.get("discount_type") if obj.get("discount_type") is not None else 'PERCENT', + "position_id": obj.get("position_id") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/discount_position_group.py b/generated/async/easybill_generated_async/models/discount_position_group.py new file mode 100644 index 0000000..ead0c48 --- /dev/null +++ b/generated/async/easybill_generated_async/models/discount_position_group.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DiscountPositionGroup(BaseModel): + """ + DiscountPositionGroup + """ # noqa: E501 + id: Optional[StrictInt] = None + customer_id: StrictInt + discount: Optional[StrictInt] = Field(default=None, description="The discount value depending on \"discount_type\". If not provided, inherits from customer when available") + discount_type: Optional[StrictStr] = Field(default='PERCENT', description="AMOUNT subtracts the value in \"discount\" from the total
QUANTITY subtracts the value in \"discount\" multiplied by quantity
PERCENT uses the value in \"discount\" as a percentage
FIX sets the value in \"discount\" as the new price. If not provided, inherits from customer when available") + position_group_id: StrictInt + __properties: ClassVar[List[str]] = ["id", "customer_id", "discount", "discount_type", "position_group_id"] + + @field_validator('discount_type') + def discount_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AMOUNT', 'PERCENT', 'QUANTITY', 'FIX']): + raise ValueError("must be one of enum values ('AMOUNT', 'PERCENT', 'QUANTITY', 'FIX')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscountPositionGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiscountPositionGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "customer_id": obj.get("customer_id"), + "discount": obj.get("discount"), + "discount_type": obj.get("discount_type") if obj.get("discount_type") is not None else 'PERCENT', + "position_group_id": obj.get("position_group_id") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/discount_position_groups.py b/generated/async/easybill_generated_async/models/discount_position_groups.py new file mode 100644 index 0000000..126273f --- /dev/null +++ b/generated/async/easybill_generated_async/models/discount_position_groups.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.discount_position_group import DiscountPositionGroup +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DiscountPositionGroups(BaseModel): + """ + DiscountPositionGroups + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[DiscountPositionGroup]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscountPositionGroups from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiscountPositionGroups from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [DiscountPositionGroup.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/discount_positions.py b/generated/async/easybill_generated_async/models/discount_positions.py new file mode 100644 index 0000000..d9168bf --- /dev/null +++ b/generated/async/easybill_generated_async/models/discount_positions.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.discount_position import DiscountPosition +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DiscountPositions(BaseModel): + """ + DiscountPositions + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[DiscountPosition]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscountPositions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiscountPositions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [DiscountPosition.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/document.py b/generated/async/easybill_generated_async/models/document.py new file mode 100644 index 0000000..929d9b7 --- /dev/null +++ b/generated/async/easybill_generated_async/models/document.py @@ -0,0 +1,491 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from easybill_generated_async.models.advanced_data_field import AdvancedDataField +from easybill_generated_async.models.customer_snapshot import CustomerSnapshot +from easybill_generated_async.models.document_address import DocumentAddress +from easybill_generated_async.models.document_position import DocumentPosition +from easybill_generated_async.models.document_recurring import DocumentRecurring +from easybill_generated_async.models.file_format_config import FileFormatConfig +from easybill_generated_async.models.service_date import ServiceDate +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Document(BaseModel): + """ + Document + """ # noqa: E501 + address: Optional[DocumentAddress] = None + advanced_data_fields: Optional[List[AdvancedDataField]] = Field(default=None, description="EN16931 Business Terms (BT fields) for structured invoice data. On update the submitted list fully replaces the existing fields — send an empty array to clear all.") + attachment_ids: Optional[List[StrictInt]] = None + label_address: Optional[DocumentAddress] = None + amount: Optional[StrictInt] = Field(default=None, description="Amount in cents (e.g. \"150\" = 1.50€)") + amount_net: Optional[StrictInt] = Field(default=None, description="Amount in cents (e.g. \"150\" = 1.50€)") + anonymize_due_date: Optional[date] = Field(default=None, description="A date which signals when to anonymize the document. Must be in the future. Turns into a read only field if the document is anonymized") + anonymize_status: Optional[StrictStr] = Field(default='NOT_ANONYMIZED', description="This field signals if the document was anonymized") + anonymized_at: Optional[StrictStr] = None + bank_debit_form: Optional[StrictStr] = 'null' + billing_country: Optional[StrictStr] = None + calc_vat_from: Optional[StrictInt] = Field(default=None, description="0 === Net, 1 === Gross.") + cancel_id: Optional[StrictInt] = Field(default=None, description="ID from the cancel document. Only for document type INVOICE.") + cash_allowance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Cash allowance percentage. If not provided, inherits from customer when available.") + cash_allowance_days: Optional[StrictInt] = Field(default=None, description="Days for cash allowance. If not provided, inherits from customer when available.") + cash_allowance_text: Optional[StrictStr] = 'null' + contact_id: Optional[StrictInt] = None + contact_label: Optional[StrictStr] = '' + contact_text: Optional[StrictStr] = '' + created_at: Optional[datetime] = None + currency: Optional[StrictStr] = 'EUR' + customer_id: Optional[StrictInt] = None + customer_snapshot: Optional[CustomerSnapshot] = None + discount: Optional[StrictStr] = 'null' + discount_type: Optional[StrictStr] = null + document_date: Optional[date] = None + due_date: Optional[date] = Field(default=None, description="To change the value use grace_period.") + edited_at: Optional[datetime] = None + external_id: Optional[StrictStr] = 'null' + replica_url: Optional[StrictStr] = 'null' + grace_period: Optional[StrictInt] = Field(default=None, description="will be replaced by its alias due_in_days.") + due_in_days: Optional[StrictInt] = Field(default=None, description="due date in days. If not provided, inherits from customer when available") + id: Optional[StrictInt] = None + is_acceptable_on_public_domain: Optional[StrictBool] = Field(default=False, description="Indicates if a document can be accepted by the end customer through the document's public access page.") + is_archive: Optional[StrictBool] = False + is_draft: Optional[StrictBool] = Field(default=None, description="This property is read only. To finish the document call /documents/{id}/done.") + is_replica: Optional[StrictBool] = Field(default=False, description="Marks a document as a replica from another software.") + is_oss: Optional[StrictBool] = Field(default=False, description="Indicates if a document is a one-stop-shop document") + item_notes: Optional[List[StrictStr]] = Field(default=None, description="Field holds all unique document_note of items for the document") + items: Optional[List[DocumentPosition]] = None + last_postbox_id: Optional[StrictInt] = None + login_id: Optional[StrictInt] = Field(default=None, description="If omitted or null, the currently active login is used.") + number: Optional[StrictStr] = 'null' + order_number: Optional[StrictStr] = '' + buyer_reference: Optional[StrictStr] = '' + paid_amount: Optional[StrictInt] = None + paid_at: Optional[date] = None + pdf_pages: Optional[StrictInt] = None + pdf_template: Optional[StrictStr] = Field(default=None, description="Default template is null or 'DE', default english is 'EN' and for all others use the numeric template ID.") + payment_link_enabled: Optional[StrictBool] = Field(default=False, description="Whether the payment link is shown on this document. Overrides the setting from the referenced template.") + payment_link_locale: Optional[StrictStr] = Field(default='de', description="Language of the payment link text on the document.") + project_id: Optional[StrictInt] = None + recurring_options: Optional[DocumentRecurring] = None + ref_id: Optional[StrictInt] = Field(default=None, description="Reference document id") + root_id: Optional[StrictInt] = Field(default=None, description="Root document id") + service_date: Optional[ServiceDate] = None + shipping_country: Optional[StrictStr] = 'null' + status: Optional[StrictStr] = Field(default=null, description="This value can only be used in document type DELIVERY, ORDER, CHARGE or OFFER. NULL is default = not set.") + text: Optional[StrictStr] = None + text_prefix: Optional[StrictStr] = None + text_tax: Optional[StrictStr] = Field(default='null', description="Overwrites the default vat-option text from the document layout. It is only displayed in documents with the type other than: Delivery, Dunning, Reminder or Letter and a different vat-option than null") + title: Optional[StrictStr] = 'null' + type: Optional[StrictStr] = Field(default='INVOICE', description="Can only set on create.") + use_shipping_address: Optional[StrictBool] = Field(default=False, description="If true and customer has shipping address then it will be used.") + vat_country: Optional[StrictStr] = 'null' + vat_id: Optional[StrictStr] = '' + fulfillment_country: Optional[StrictStr] = 'null' + vat_option: Optional[StrictStr] = Field(default=null, description="NULL: Normal steuerbar
nStb: Nicht steuerbar (Drittland)
nStbUstID: Nicht steuerbar (EU mit USt-IdNr.)
nStbNoneUstID: Nicht steuerbar (EU ohne USt-IdNr.)
nStbIm: Nicht steuerbarer Innenumsatz
revc: Steuerschuldwechsel §13b (Inland)
IG: Innergemeinschaftliche Lieferung
AL: Ausfuhrlieferung
sStfr: sonstige Steuerbefreiung
smallBusiness: Kleinunternehmen (Keine MwSt.)") + file_format_config: Optional[List[FileFormatConfig]] = None + __properties: ClassVar[List[str]] = ["address", "advanced_data_fields", "attachment_ids", "label_address", "amount", "amount_net", "anonymize_due_date", "anonymize_status", "anonymized_at", "bank_debit_form", "billing_country", "calc_vat_from", "cancel_id", "cash_allowance", "cash_allowance_days", "cash_allowance_text", "contact_id", "contact_label", "contact_text", "created_at", "currency", "customer_id", "customer_snapshot", "discount", "discount_type", "document_date", "due_date", "edited_at", "external_id", "replica_url", "grace_period", "due_in_days", "id", "is_acceptable_on_public_domain", "is_archive", "is_draft", "is_replica", "is_oss", "item_notes", "items", "last_postbox_id", "login_id", "number", "order_number", "buyer_reference", "paid_amount", "paid_at", "pdf_pages", "pdf_template", "payment_link_enabled", "payment_link_locale", "project_id", "recurring_options", "ref_id", "root_id", "service_date", "shipping_country", "status", "text", "text_prefix", "text_tax", "title", "type", "use_shipping_address", "vat_country", "vat_id", "fulfillment_country", "vat_option", "file_format_config"] + + @field_validator('anonymize_status') + def anonymize_status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['NOT_ANONYMIZED', 'ANONYMIZED']): + raise ValueError("must be one of enum values ('NOT_ANONYMIZED', 'ANONYMIZED')") + return value + + @field_validator('discount_type') + def discount_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PERCENT', 'AMOUNT']): + raise ValueError("must be one of enum values ('PERCENT', 'AMOUNT')") + return value + + @field_validator('payment_link_locale') + def payment_link_locale_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['de', 'en']): + raise ValueError("must be one of enum values ('de', 'en')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ACCEPT', 'DONE', 'DROPSHIPPING', 'CANCEL']): + raise ValueError("must be one of enum values ('ACCEPT', 'DONE', 'DROPSHIPPING', 'CANCEL')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['INVOICE', 'RECURRING', 'CREDIT', 'OFFER', 'REMINDER', 'DUNNING', 'STORNO', 'STORNO_CREDIT', 'DELIVERY', 'PDF', 'CHARGE', 'CHARGE_CONFIRM', 'LETTER', 'ORDER', 'PROFORMA_INVOICE', 'STORNO_PROFORMA_INVOICE']): + raise ValueError("must be one of enum values ('INVOICE', 'RECURRING', 'CREDIT', 'OFFER', 'REMINDER', 'DUNNING', 'STORNO', 'STORNO_CREDIT', 'DELIVERY', 'PDF', 'CHARGE', 'CHARGE_CONFIRM', 'LETTER', 'ORDER', 'PROFORMA_INVOICE', 'STORNO_PROFORMA_INVOICE')") + return value + + @field_validator('vat_option') + def vat_option_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['NULL', 'nStb', 'nStbUstID', 'nStbNoneUstID', 'nStbIm', 'revc', 'IG', 'AL', 'sStfr', 'smallBusiness']): + raise ValueError("must be one of enum values ('NULL', 'nStb', 'nStbUstID', 'nStbNoneUstID', 'nStbIm', 'revc', 'IG', 'AL', 'sStfr', 'smallBusiness')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Document from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "attachment_ids", + "amount", + "amount_net", + "anonymize_status", + "anonymized_at", + "billing_country", + "cancel_id", + "created_at", + "due_date", + "edited_at", + "id", + "is_draft", + "item_notes", + "last_postbox_id", + "paid_amount", + "paid_at", + "pdf_pages", + "root_id", + "vat_id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of address + if self.address: + _dict['address'] = self.address.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in advanced_data_fields (list) + _items = [] + if self.advanced_data_fields: + for _item_advanced_data_fields in self.advanced_data_fields: + if _item_advanced_data_fields: + _items.append(_item_advanced_data_fields.to_dict()) + _dict['advanced_data_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of label_address + if self.label_address: + _dict['label_address'] = self.label_address.to_dict() + # override the default output from pydantic by calling `to_dict()` of customer_snapshot + if self.customer_snapshot: + _dict['customer_snapshot'] = self.customer_snapshot.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + # override the default output from pydantic by calling `to_dict()` of recurring_options + if self.recurring_options: + _dict['recurring_options'] = self.recurring_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of service_date + if self.service_date: + _dict['service_date'] = self.service_date.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in file_format_config (list) + _items = [] + if self.file_format_config: + for _item_file_format_config in self.file_format_config: + if _item_file_format_config: + _items.append(_item_file_format_config.to_dict()) + _dict['file_format_config'] = _items + # set to None if anonymize_due_date (nullable) is None + # and model_fields_set contains the field + if self.anonymize_due_date is None and "anonymize_due_date" in self.model_fields_set: + _dict['anonymize_due_date'] = None + + # set to None if anonymized_at (nullable) is None + # and model_fields_set contains the field + if self.anonymized_at is None and "anonymized_at" in self.model_fields_set: + _dict['anonymized_at'] = None + + # set to None if bank_debit_form (nullable) is None + # and model_fields_set contains the field + if self.bank_debit_form is None and "bank_debit_form" in self.model_fields_set: + _dict['bank_debit_form'] = None + + # set to None if cash_allowance (nullable) is None + # and model_fields_set contains the field + if self.cash_allowance is None and "cash_allowance" in self.model_fields_set: + _dict['cash_allowance'] = None + + # set to None if cash_allowance_days (nullable) is None + # and model_fields_set contains the field + if self.cash_allowance_days is None and "cash_allowance_days" in self.model_fields_set: + _dict['cash_allowance_days'] = None + + # set to None if cash_allowance_text (nullable) is None + # and model_fields_set contains the field + if self.cash_allowance_text is None and "cash_allowance_text" in self.model_fields_set: + _dict['cash_allowance_text'] = None + + # set to None if contact_id (nullable) is None + # and model_fields_set contains the field + if self.contact_id is None and "contact_id" in self.model_fields_set: + _dict['contact_id'] = None + + # set to None if customer_id (nullable) is None + # and model_fields_set contains the field + if self.customer_id is None and "customer_id" in self.model_fields_set: + _dict['customer_id'] = None + + # set to None if discount (nullable) is None + # and model_fields_set contains the field + if self.discount is None and "discount" in self.model_fields_set: + _dict['discount'] = None + + # set to None if discount_type (nullable) is None + # and model_fields_set contains the field + if self.discount_type is None and "discount_type" in self.model_fields_set: + _dict['discount_type'] = None + + # set to None if external_id (nullable) is None + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: + _dict['external_id'] = None + + # set to None if replica_url (nullable) is None + # and model_fields_set contains the field + if self.replica_url is None and "replica_url" in self.model_fields_set: + _dict['replica_url'] = None + + # set to None if grace_period (nullable) is None + # and model_fields_set contains the field + if self.grace_period is None and "grace_period" in self.model_fields_set: + _dict['grace_period'] = None + + # set to None if due_in_days (nullable) is None + # and model_fields_set contains the field + if self.due_in_days is None and "due_in_days" in self.model_fields_set: + _dict['due_in_days'] = None + + # set to None if number (nullable) is None + # and model_fields_set contains the field + if self.number is None and "number" in self.model_fields_set: + _dict['number'] = None + + # set to None if project_id (nullable) is None + # and model_fields_set contains the field + if self.project_id is None and "project_id" in self.model_fields_set: + _dict['project_id'] = None + + # set to None if ref_id (nullable) is None + # and model_fields_set contains the field + if self.ref_id is None and "ref_id" in self.model_fields_set: + _dict['ref_id'] = None + + # set to None if root_id (nullable) is None + # and model_fields_set contains the field + if self.root_id is None and "root_id" in self.model_fields_set: + _dict['root_id'] = None + + # set to None if shipping_country (nullable) is None + # and model_fields_set contains the field + if self.shipping_country is None and "shipping_country" in self.model_fields_set: + _dict['shipping_country'] = None + + # set to None if status (nullable) is None + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: + _dict['status'] = None + + # set to None if text_tax (nullable) is None + # and model_fields_set contains the field + if self.text_tax is None and "text_tax" in self.model_fields_set: + _dict['text_tax'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + # set to None if vat_country (nullable) is None + # and model_fields_set contains the field + if self.vat_country is None and "vat_country" in self.model_fields_set: + _dict['vat_country'] = None + + # set to None if fulfillment_country (nullable) is None + # and model_fields_set contains the field + if self.fulfillment_country is None and "fulfillment_country" in self.model_fields_set: + _dict['fulfillment_country'] = None + + # set to None if vat_option (nullable) is None + # and model_fields_set contains the field + if self.vat_option is None and "vat_option" in self.model_fields_set: + _dict['vat_option'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Document from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": DocumentAddress.from_dict(obj["address"]) if obj.get("address") is not None else None, + "advanced_data_fields": [AdvancedDataField.from_dict(_item) for _item in obj["advanced_data_fields"]] if obj.get("advanced_data_fields") is not None else None, + "attachment_ids": obj.get("attachment_ids"), + "label_address": DocumentAddress.from_dict(obj["label_address"]) if obj.get("label_address") is not None else None, + "amount": obj.get("amount"), + "amount_net": obj.get("amount_net"), + "anonymize_due_date": obj.get("anonymize_due_date"), + "anonymize_status": obj.get("anonymize_status") if obj.get("anonymize_status") is not None else 'NOT_ANONYMIZED', + "anonymized_at": obj.get("anonymized_at"), + "bank_debit_form": obj.get("bank_debit_form") if obj.get("bank_debit_form") is not None else 'null', + "billing_country": obj.get("billing_country"), + "calc_vat_from": obj.get("calc_vat_from"), + "cancel_id": obj.get("cancel_id"), + "cash_allowance": obj.get("cash_allowance"), + "cash_allowance_days": obj.get("cash_allowance_days"), + "cash_allowance_text": obj.get("cash_allowance_text") if obj.get("cash_allowance_text") is not None else 'null', + "contact_id": obj.get("contact_id"), + "contact_label": obj.get("contact_label") if obj.get("contact_label") is not None else '', + "contact_text": obj.get("contact_text") if obj.get("contact_text") is not None else '', + "created_at": obj.get("created_at"), + "currency": obj.get("currency") if obj.get("currency") is not None else 'EUR', + "customer_id": obj.get("customer_id"), + "customer_snapshot": CustomerSnapshot.from_dict(obj["customer_snapshot"]) if obj.get("customer_snapshot") is not None else None, + "discount": obj.get("discount") if obj.get("discount") is not None else 'null', + "discount_type": obj.get("discount_type") if obj.get("discount_type") is not None else null, + "document_date": obj.get("document_date"), + "due_date": obj.get("due_date"), + "edited_at": obj.get("edited_at"), + "external_id": obj.get("external_id") if obj.get("external_id") is not None else 'null', + "replica_url": obj.get("replica_url") if obj.get("replica_url") is not None else 'null', + "grace_period": obj.get("grace_period"), + "due_in_days": obj.get("due_in_days"), + "id": obj.get("id"), + "is_acceptable_on_public_domain": obj.get("is_acceptable_on_public_domain") if obj.get("is_acceptable_on_public_domain") is not None else False, + "is_archive": obj.get("is_archive") if obj.get("is_archive") is not None else False, + "is_draft": obj.get("is_draft"), + "is_replica": obj.get("is_replica") if obj.get("is_replica") is not None else False, + "is_oss": obj.get("is_oss") if obj.get("is_oss") is not None else False, + "item_notes": obj.get("item_notes"), + "items": [DocumentPosition.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "last_postbox_id": obj.get("last_postbox_id"), + "login_id": obj.get("login_id"), + "number": obj.get("number") if obj.get("number") is not None else 'null', + "order_number": obj.get("order_number") if obj.get("order_number") is not None else '', + "buyer_reference": obj.get("buyer_reference") if obj.get("buyer_reference") is not None else '', + "paid_amount": obj.get("paid_amount"), + "paid_at": obj.get("paid_at"), + "pdf_pages": obj.get("pdf_pages"), + "pdf_template": obj.get("pdf_template"), + "payment_link_enabled": obj.get("payment_link_enabled") if obj.get("payment_link_enabled") is not None else False, + "payment_link_locale": obj.get("payment_link_locale") if obj.get("payment_link_locale") is not None else 'de', + "project_id": obj.get("project_id"), + "recurring_options": DocumentRecurring.from_dict(obj["recurring_options"]) if obj.get("recurring_options") is not None else None, + "ref_id": obj.get("ref_id"), + "root_id": obj.get("root_id"), + "service_date": ServiceDate.from_dict(obj["service_date"]) if obj.get("service_date") is not None else None, + "shipping_country": obj.get("shipping_country") if obj.get("shipping_country") is not None else 'null', + "status": obj.get("status") if obj.get("status") is not None else null, + "text": obj.get("text"), + "text_prefix": obj.get("text_prefix"), + "text_tax": obj.get("text_tax") if obj.get("text_tax") is not None else 'null', + "title": obj.get("title") if obj.get("title") is not None else 'null', + "type": obj.get("type") if obj.get("type") is not None else 'INVOICE', + "use_shipping_address": obj.get("use_shipping_address") if obj.get("use_shipping_address") is not None else False, + "vat_country": obj.get("vat_country") if obj.get("vat_country") is not None else 'null', + "vat_id": obj.get("vat_id") if obj.get("vat_id") is not None else '', + "fulfillment_country": obj.get("fulfillment_country") if obj.get("fulfillment_country") is not None else 'null', + "vat_option": obj.get("vat_option") if obj.get("vat_option") is not None else null, + "file_format_config": [FileFormatConfig.from_dict(_item) for _item in obj["file_format_config"]] if obj.get("file_format_config") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/document_address.py b/generated/async/easybill_generated_async/models/document_address.py new file mode 100644 index 0000000..6e19180 --- /dev/null +++ b/generated/async/easybill_generated_async/models/document_address.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentAddress(BaseModel): + """ + This information comes from the customer which can be set with customer_id. + """ # noqa: E501 + salutation: Optional[StrictInt] = Field(default=None, description="0: empty
1: Herrn
2: Frau
3: Firma
4: Herrn und Frau
5: Eheleute
6: Familie") + personal: Optional[StrictBool] = None + title: Optional[StrictStr] = None + first_name: Optional[StrictStr] = None + last_name: Optional[StrictStr] = None + suffix_1: Optional[StrictStr] = None + suffix_2: Optional[StrictStr] = None + company_name: Optional[StrictStr] = None + street: Optional[StrictStr] = None + zip_code: Optional[StrictStr] = None + city: Optional[StrictStr] = None + state: Optional[StrictStr] = None + country: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["salutation", "personal", "title", "first_name", "last_name", "suffix_1", "suffix_2", "company_name", "street", "zip_code", "city", "state", "country"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentAddress from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "salutation", + "personal", + "title", + "first_name", + "last_name", + "suffix_1", + "suffix_2", + "company_name", + "street", + "zip_code", + "city", + "state", + "country", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentAddress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "salutation": obj.get("salutation"), + "personal": obj.get("personal"), + "title": obj.get("title"), + "first_name": obj.get("first_name"), + "last_name": obj.get("last_name"), + "suffix_1": obj.get("suffix_1"), + "suffix_2": obj.get("suffix_2"), + "company_name": obj.get("company_name"), + "street": obj.get("street"), + "zip_code": obj.get("zip_code"), + "city": obj.get("city"), + "state": obj.get("state"), + "country": obj.get("country") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/document_payment.py b/generated/async/easybill_generated_async/models/document_payment.py new file mode 100644 index 0000000..5f5d6c3 --- /dev/null +++ b/generated/async/easybill_generated_async/models/document_payment.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentPayment(BaseModel): + """ + DocumentPayment + """ # noqa: E501 + amount: StrictInt + document_id: StrictInt + id: Optional[StrictInt] = None + is_overdue_fee: Optional[StrictBool] = None + login_id: Optional[StrictInt] = None + notice: Optional[StrictStr] = '' + payment_at: Optional[date] = None + type: Optional[Annotated[str, Field(strict=True, max_length=255)]] = '' + provider: Optional[Annotated[str, Field(strict=True, max_length=255)]] = '' + reference: Optional[Annotated[str, Field(strict=True, max_length=255)]] = '' + __properties: ClassVar[List[str]] = ["amount", "document_id", "id", "is_overdue_fee", "login_id", "notice", "payment_at", "type", "provider", "reference"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentPayment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "login_id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentPayment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "amount": obj.get("amount"), + "document_id": obj.get("document_id"), + "id": obj.get("id"), + "is_overdue_fee": obj.get("is_overdue_fee"), + "login_id": obj.get("login_id"), + "notice": obj.get("notice") if obj.get("notice") is not None else '', + "payment_at": obj.get("payment_at"), + "type": obj.get("type") if obj.get("type") is not None else '', + "provider": obj.get("provider") if obj.get("provider") is not None else '', + "reference": obj.get("reference") if obj.get("reference") is not None else '' + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/document_payments.py b/generated/async/easybill_generated_async/models/document_payments.py new file mode 100644 index 0000000..0ccabbb --- /dev/null +++ b/generated/async/easybill_generated_async/models/document_payments.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.document_payment import DocumentPayment +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentPayments(BaseModel): + """ + DocumentPayments + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[DocumentPayment]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentPayments from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentPayments from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [DocumentPayment.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/document_position.py b/generated/async/easybill_generated_async/models/document_position.py new file mode 100644 index 0000000..05348eb --- /dev/null +++ b/generated/async/easybill_generated_async/models/document_position.py @@ -0,0 +1,256 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentPosition(BaseModel): + """ + DocumentPosition + """ # noqa: E501 + number: Optional[StrictStr] = 'null' + description: Optional[StrictStr] = 'null' + document_note: Optional[StrictStr] = Field(default=None, description="This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction.") + quantity: Optional[Union[StrictFloat, StrictInt]] = 1.0 + quantity_str: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="Use quantity_str if you want to set a quantity like: 1:30 h or 3x5 m. quantity_str overwrites quantity.") + unit: Optional[StrictStr] = 'null' + type: Optional[StrictStr] = 'POSITION' + position: Optional[StrictInt] = Field(default=None, description="Automatic by default (first item: 1, second item: 2, ...)") + single_price_net: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)") + single_price_gross: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)") + vat_percent: Optional[Union[StrictFloat, StrictInt]] = 0.0 + discount: Optional[Union[StrictFloat, StrictInt]] = None + discount_type: Optional[StrictStr] = null + position_id: Optional[StrictInt] = Field(default=None, description="If set, values are copied from the referenced position") + total_price_net: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)") + total_price_gross: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)") + total_vat: Optional[Union[StrictFloat, StrictInt]] = None + serial_number_id: Optional[StrictStr] = None + serial_number: Optional[StrictStr] = None + booking_account: Optional[StrictStr] = 'null' + export_cost_1: Optional[StrictStr] = 'null' + export_cost_2: Optional[StrictStr] = 'null' + cost_price_net: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)") + cost_price_total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)") + cost_price_charge: Optional[Union[StrictFloat, StrictInt]] = None + cost_price_charge_type: Optional[StrictStr] = None + item_type: Optional[StrictStr] = Field(default='UNDEFINED', alias="itemType") + id: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["number", "description", "document_note", "quantity", "quantity_str", "unit", "type", "position", "single_price_net", "single_price_gross", "vat_percent", "discount", "discount_type", "position_id", "total_price_net", "total_price_gross", "total_vat", "serial_number_id", "serial_number", "booking_account", "export_cost_1", "export_cost_2", "cost_price_net", "cost_price_total", "cost_price_charge", "cost_price_charge_type", "itemType", "id"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['POSITION', 'POSITION_NOCALC', 'TEXT']): + raise ValueError("must be one of enum values ('POSITION', 'POSITION_NOCALC', 'TEXT')") + return value + + @field_validator('discount_type') + def discount_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PERCENT', 'AMOUNT', 'QUANTITY', 'FIX']): + raise ValueError("must be one of enum values ('PERCENT', 'AMOUNT', 'QUANTITY', 'FIX')") + return value + + @field_validator('cost_price_charge_type') + def cost_price_charge_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PERCENT', 'AMOUNT']): + raise ValueError("must be one of enum values ('PERCENT', 'AMOUNT')") + return value + + @field_validator('item_type') + def item_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PRODUCT', 'SERVICE', 'UNDEFINED']): + raise ValueError("must be one of enum values ('PRODUCT', 'SERVICE', 'UNDEFINED')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentPosition from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "total_price_net", + "total_price_gross", + "total_vat", + "serial_number_id", + "serial_number", + "cost_price_total", + "cost_price_charge", + "cost_price_charge_type", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if number (nullable) is None + # and model_fields_set contains the field + if self.number is None and "number" in self.model_fields_set: + _dict['number'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if unit (nullable) is None + # and model_fields_set contains the field + if self.unit is None and "unit" in self.model_fields_set: + _dict['unit'] = None + + # set to None if single_price_net (nullable) is None + # and model_fields_set contains the field + if self.single_price_net is None and "single_price_net" in self.model_fields_set: + _dict['single_price_net'] = None + + # set to None if discount (nullable) is None + # and model_fields_set contains the field + if self.discount is None and "discount" in self.model_fields_set: + _dict['discount'] = None + + # set to None if discount_type (nullable) is None + # and model_fields_set contains the field + if self.discount_type is None and "discount_type" in self.model_fields_set: + _dict['discount_type'] = None + + # set to None if position_id (nullable) is None + # and model_fields_set contains the field + if self.position_id is None and "position_id" in self.model_fields_set: + _dict['position_id'] = None + + # set to None if booking_account (nullable) is None + # and model_fields_set contains the field + if self.booking_account is None and "booking_account" in self.model_fields_set: + _dict['booking_account'] = None + + # set to None if export_cost_1 (nullable) is None + # and model_fields_set contains the field + if self.export_cost_1 is None and "export_cost_1" in self.model_fields_set: + _dict['export_cost_1'] = None + + # set to None if export_cost_2 (nullable) is None + # and model_fields_set contains the field + if self.export_cost_2 is None and "export_cost_2" in self.model_fields_set: + _dict['export_cost_2'] = None + + # set to None if cost_price_net (nullable) is None + # and model_fields_set contains the field + if self.cost_price_net is None and "cost_price_net" in self.model_fields_set: + _dict['cost_price_net'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentPosition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "number": obj.get("number") if obj.get("number") is not None else 'null', + "description": obj.get("description") if obj.get("description") is not None else 'null', + "document_note": obj.get("document_note"), + "quantity": obj.get("quantity") if obj.get("quantity") is not None else 1.0, + "quantity_str": obj.get("quantity_str"), + "unit": obj.get("unit") if obj.get("unit") is not None else 'null', + "type": obj.get("type") if obj.get("type") is not None else 'POSITION', + "position": obj.get("position"), + "single_price_net": obj.get("single_price_net"), + "single_price_gross": obj.get("single_price_gross"), + "vat_percent": obj.get("vat_percent") if obj.get("vat_percent") is not None else 0.0, + "discount": obj.get("discount"), + "discount_type": obj.get("discount_type") if obj.get("discount_type") is not None else null, + "position_id": obj.get("position_id"), + "total_price_net": obj.get("total_price_net"), + "total_price_gross": obj.get("total_price_gross"), + "total_vat": obj.get("total_vat"), + "serial_number_id": obj.get("serial_number_id"), + "serial_number": obj.get("serial_number"), + "booking_account": obj.get("booking_account") if obj.get("booking_account") is not None else 'null', + "export_cost_1": obj.get("export_cost_1") if obj.get("export_cost_1") is not None else 'null', + "export_cost_2": obj.get("export_cost_2") if obj.get("export_cost_2") is not None else 'null', + "cost_price_net": obj.get("cost_price_net"), + "cost_price_total": obj.get("cost_price_total"), + "cost_price_charge": obj.get("cost_price_charge"), + "cost_price_charge_type": obj.get("cost_price_charge_type"), + "itemType": obj.get("itemType") if obj.get("itemType") is not None else 'UNDEFINED', + "id": obj.get("id") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/document_recurring.py b/generated/async/easybill_generated_async/models/document_recurring.py new file mode 100644 index 0000000..3157e16 --- /dev/null +++ b/generated/async/easybill_generated_async/models/document_recurring.py @@ -0,0 +1,238 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentRecurring(BaseModel): + """ + This object is only available in document type RECURRING. + """ # noqa: E501 + next_date: date = Field(description="Must be in the future") + frequency: Optional[StrictStr] = 'MONTHLY' + frequency_special: Optional[StrictStr] = null + interval: Optional[StrictInt] = None + end_date_or_count: Optional[StrictStr] = Field(default='null', description="Date of last exectution day or number of times to exectute") + status: Optional[StrictStr] = 'WAITING' + as_draft: Optional[StrictBool] = False + is_notify: Optional[StrictBool] = False + send_as: Optional[StrictStr] = null + is_sign: Optional[StrictBool] = False + is_paid: Optional[StrictBool] = False + paid_date_option: Optional[StrictStr] = Field(default='created_date', description="Option is used to determine what date is used for the payment if is_paid is true. \"next_valid_date\" selects the next workday in regards to the created date of the document if the date falls on a saturday or sunday.") + is_sepa: Optional[StrictBool] = False + sepa_local_instrument: Optional[StrictStr] = Field(default=null, description="COR1 is deprecated use CORE instead.") + sepa_sequence_type: Optional[StrictStr] = null + sepa_reference: Optional[StrictStr] = 'null' + sepa_remittance_information: Optional[StrictStr] = 'null' + target_type: Optional[StrictStr] = Field(default='INVOICE', description="The document type that will be generated. Can not be changed on existing documents.") + __properties: ClassVar[List[str]] = ["next_date", "frequency", "frequency_special", "interval", "end_date_or_count", "status", "as_draft", "is_notify", "send_as", "is_sign", "is_paid", "paid_date_option", "is_sepa", "sepa_local_instrument", "sepa_sequence_type", "sepa_reference", "sepa_remittance_information", "target_type"] + + @field_validator('frequency') + def frequency_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['DAILY', 'WEEKLY', 'MONTHLY', 'YEARLY']): + raise ValueError("must be one of enum values ('DAILY', 'WEEKLY', 'MONTHLY', 'YEARLY')") + return value + + @field_validator('frequency_special') + def frequency_special_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['LASTDAYOFMONTH']): + raise ValueError("must be one of enum values ('LASTDAYOFMONTH')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['RUNNING', 'PAUSE', 'STOP', 'WAITING']): + raise ValueError("must be one of enum values ('RUNNING', 'PAUSE', 'STOP', 'WAITING')") + return value + + @field_validator('send_as') + def send_as_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['EMAIL', 'FAX', 'POST']): + raise ValueError("must be one of enum values ('EMAIL', 'FAX', 'POST')") + return value + + @field_validator('paid_date_option') + def paid_date_option_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['created_date', 'due_date', 'next_valid_date']): + raise ValueError("must be one of enum values ('created_date', 'due_date', 'next_valid_date')") + return value + + @field_validator('sepa_local_instrument') + def sepa_local_instrument_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['CORE', 'COR1', 'B2B']): + raise ValueError("must be one of enum values ('CORE', 'COR1', 'B2B')") + return value + + @field_validator('sepa_sequence_type') + def sepa_sequence_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['FRST', 'OOFF', 'FNAL', 'RCUR']): + raise ValueError("must be one of enum values ('FRST', 'OOFF', 'FNAL', 'RCUR')") + return value + + @field_validator('target_type') + def target_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['INVOICE', 'CREDIT', 'ORDER', 'OFFER']): + raise ValueError("must be one of enum values ('INVOICE', 'CREDIT', 'ORDER', 'OFFER')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentRecurring from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if frequency_special (nullable) is None + # and model_fields_set contains the field + if self.frequency_special is None and "frequency_special" in self.model_fields_set: + _dict['frequency_special'] = None + + # set to None if end_date_or_count (nullable) is None + # and model_fields_set contains the field + if self.end_date_or_count is None and "end_date_or_count" in self.model_fields_set: + _dict['end_date_or_count'] = None + + # set to None if send_as (nullable) is None + # and model_fields_set contains the field + if self.send_as is None and "send_as" in self.model_fields_set: + _dict['send_as'] = None + + # set to None if sepa_local_instrument (nullable) is None + # and model_fields_set contains the field + if self.sepa_local_instrument is None and "sepa_local_instrument" in self.model_fields_set: + _dict['sepa_local_instrument'] = None + + # set to None if sepa_sequence_type (nullable) is None + # and model_fields_set contains the field + if self.sepa_sequence_type is None and "sepa_sequence_type" in self.model_fields_set: + _dict['sepa_sequence_type'] = None + + # set to None if sepa_reference (nullable) is None + # and model_fields_set contains the field + if self.sepa_reference is None and "sepa_reference" in self.model_fields_set: + _dict['sepa_reference'] = None + + # set to None if sepa_remittance_information (nullable) is None + # and model_fields_set contains the field + if self.sepa_remittance_information is None and "sepa_remittance_information" in self.model_fields_set: + _dict['sepa_remittance_information'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentRecurring from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "next_date": obj.get("next_date"), + "frequency": obj.get("frequency") if obj.get("frequency") is not None else 'MONTHLY', + "frequency_special": obj.get("frequency_special") if obj.get("frequency_special") is not None else null, + "interval": obj.get("interval"), + "end_date_or_count": obj.get("end_date_or_count") if obj.get("end_date_or_count") is not None else 'null', + "status": obj.get("status") if obj.get("status") is not None else 'WAITING', + "as_draft": obj.get("as_draft") if obj.get("as_draft") is not None else False, + "is_notify": obj.get("is_notify") if obj.get("is_notify") is not None else False, + "send_as": obj.get("send_as") if obj.get("send_as") is not None else null, + "is_sign": obj.get("is_sign") if obj.get("is_sign") is not None else False, + "is_paid": obj.get("is_paid") if obj.get("is_paid") is not None else False, + "paid_date_option": obj.get("paid_date_option") if obj.get("paid_date_option") is not None else 'created_date', + "is_sepa": obj.get("is_sepa") if obj.get("is_sepa") is not None else False, + "sepa_local_instrument": obj.get("sepa_local_instrument") if obj.get("sepa_local_instrument") is not None else null, + "sepa_sequence_type": obj.get("sepa_sequence_type") if obj.get("sepa_sequence_type") is not None else null, + "sepa_reference": obj.get("sepa_reference") if obj.get("sepa_reference") is not None else 'null', + "sepa_remittance_information": obj.get("sepa_remittance_information") if obj.get("sepa_remittance_information") is not None else 'null', + "target_type": obj.get("target_type") if obj.get("target_type") is not None else 'INVOICE' + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/document_version.py b/generated/async/easybill_generated_async/models/document_version.py new file mode 100644 index 0000000..a521414 --- /dev/null +++ b/generated/async/easybill_generated_async/models/document_version.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.document_version_item import DocumentVersionItem +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentVersion(BaseModel): + """ + DocumentVersion + """ # noqa: E501 + created_at: Optional[datetime] = None + document_id: Optional[StrictInt] = None + id: Optional[StrictInt] = None + items: Optional[List[DocumentVersionItem]] = None + reason: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["created_at", "document_id", "id", "items", "reason"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentVersion from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "document_id", + "id", + "reason", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentVersion from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "document_id": obj.get("document_id"), + "id": obj.get("id"), + "items": [DocumentVersionItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "reason": obj.get("reason") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/document_version_item.py b/generated/async/easybill_generated_async/models/document_version_item.py new file mode 100644 index 0000000..67fc51f --- /dev/null +++ b/generated/async/easybill_generated_async/models/document_version_item.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentVersionItem(BaseModel): + """ + DocumentVersionItem + """ # noqa: E501 + document_version_item_type: Optional[StrictStr] = None + id: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["document_version_item_type", "id"] + + @field_validator('document_version_item_type') + def document_version_item_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'default_without_stationery', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended']): + raise ValueError("must be one of enum values ('default', 'default_without_stationery', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentVersionItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "document_version_item_type", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentVersionItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_version_item_type": obj.get("document_version_item_type"), + "id": obj.get("id") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/document_versions.py b/generated/async/easybill_generated_async/models/document_versions.py new file mode 100644 index 0000000..1d60f57 --- /dev/null +++ b/generated/async/easybill_generated_async/models/document_versions.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.document_version import DocumentVersion +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentVersions(BaseModel): + """ + DocumentVersions + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[DocumentVersion]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentVersions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentVersions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [DocumentVersion.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/documents.py b/generated/async/easybill_generated_async/models/documents.py new file mode 100644 index 0000000..c95c393 --- /dev/null +++ b/generated/async/easybill_generated_async/models/documents.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.document import Document +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Documents(BaseModel): + """ + Documents + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Document]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Documents from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Documents from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Document.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/file_format_config.py b/generated/async/easybill_generated_async/models/file_format_config.py new file mode 100644 index 0000000..9d9a86b --- /dev/null +++ b/generated/async/easybill_generated_async/models/file_format_config.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class FileFormatConfig(BaseModel): + """ + FileFormatConfig + """ # noqa: E501 + type: StrictStr + __properties: ClassVar[List[str]] = ["type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['default', 'default_without_stationery', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml']): + raise ValueError("must be one of enum values ('default', 'default_without_stationery', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FileFormatConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FileFormatConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/list.py b/generated/async/easybill_generated_async/models/list.py new file mode 100644 index 0000000..8a29455 --- /dev/null +++ b/generated/async/easybill_generated_async/models/list.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class List(BaseModel): + """ + List + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of List from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of List from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/login.py b/generated/async/easybill_generated_async/models/login.py new file mode 100644 index 0000000..4ba2f16 --- /dev/null +++ b/generated/async/easybill_generated_async/models/login.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.login_security import LoginSecurity +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Login(BaseModel): + """ + Login + """ # noqa: E501 + id: Optional[StrictInt] = None + first_name: Optional[StrictStr] = None + last_name: Optional[StrictStr] = None + display_name: Optional[StrictStr] = None + phone: Optional[StrictStr] = None + email: Optional[StrictStr] = None + email_signature: Optional[StrictStr] = None + login_type: Optional[StrictStr] = 'ASSISTANT' + locale: Optional[StrictStr] = None + time_zone: Optional[StrictStr] = None + security: Optional[LoginSecurity] = None + __properties: ClassVar[List[str]] = ["id", "first_name", "last_name", "display_name", "phone", "email", "email_signature", "login_type", "locale", "time_zone", "security"] + + @field_validator('login_type') + def login_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ADMIN', 'ASSISTANT']): + raise ValueError("must be one of enum values ('ADMIN', 'ASSISTANT')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Login from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "display_name", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of security + if self.security: + _dict['security'] = self.security.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Login from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "first_name": obj.get("first_name"), + "last_name": obj.get("last_name"), + "display_name": obj.get("display_name"), + "phone": obj.get("phone"), + "email": obj.get("email"), + "email_signature": obj.get("email_signature"), + "login_type": obj.get("login_type") if obj.get("login_type") is not None else 'ASSISTANT', + "locale": obj.get("locale"), + "time_zone": obj.get("time_zone"), + "security": LoginSecurity.from_dict(obj["security"]) if obj.get("security") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/login_security.py b/generated/async/easybill_generated_async/models/login_security.py new file mode 100644 index 0000000..ffd034d --- /dev/null +++ b/generated/async/easybill_generated_async/models/login_security.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LoginSecurity(BaseModel): + """ + This object is only displayed if your request the login resource as an admin. Otherwise this property will be null. + """ # noqa: E501 + two_factor_enabled: Optional[StrictBool] = Field(default=False, description="Shows if the login has two factor enabled for the login process") + recovery_codes_enabled: Optional[StrictBool] = Field(default=False, description="Shows if the login has recovery codes enabled to bypass two factor") + notify_on_new_login_enabled: Optional[StrictBool] = Field(default=True, description="Shows if the login has enabled to be notified if a new login is made from an unknown device.") + __properties: ClassVar[List[str]] = ["two_factor_enabled", "recovery_codes_enabled", "notify_on_new_login_enabled"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LoginSecurity from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "two_factor_enabled", + "recovery_codes_enabled", + "notify_on_new_login_enabled", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LoginSecurity from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "two_factor_enabled": obj.get("two_factor_enabled") if obj.get("two_factor_enabled") is not None else False, + "recovery_codes_enabled": obj.get("recovery_codes_enabled") if obj.get("recovery_codes_enabled") is not None else False, + "notify_on_new_login_enabled": obj.get("notify_on_new_login_enabled") if obj.get("notify_on_new_login_enabled") is not None else True + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/logins.py b/generated/async/easybill_generated_async/models/logins.py new file mode 100644 index 0000000..1cbc27a --- /dev/null +++ b/generated/async/easybill_generated_async/models/logins.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.login import Login +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Logins(BaseModel): + """ + Logins + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Login]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Logins from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Logins from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Login.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/pdf_template.py b/generated/async/easybill_generated_async/models/pdf_template.py new file mode 100644 index 0000000..bc26929 --- /dev/null +++ b/generated/async/easybill_generated_async/models/pdf_template.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.pdf_template_settings import PDFTemplateSettings +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PDFTemplate(BaseModel): + """ + PDFTemplate + """ # noqa: E501 + id: Optional[StrictStr] = 'INVOICE-DE' + name: Optional[StrictStr] = 'Default template' + pdf_template: Optional[StrictStr] = 'DE' + document_type: Optional[StrictStr] = 'INVOICE' + settings: Optional[PDFTemplateSettings] = None + __properties: ClassVar[List[str]] = ["id", "name", "pdf_template", "document_type", "settings"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PDFTemplate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of settings + if self.settings: + _dict['settings'] = self.settings.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PDFTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id") if obj.get("id") is not None else 'INVOICE-DE', + "name": obj.get("name") if obj.get("name") is not None else 'Default template', + "pdf_template": obj.get("pdf_template") if obj.get("pdf_template") is not None else 'DE', + "document_type": obj.get("document_type") if obj.get("document_type") is not None else 'INVOICE', + "settings": PDFTemplateSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/pdf_template_settings.py b/generated/async/easybill_generated_async/models/pdf_template_settings.py new file mode 100644 index 0000000..8d4111f --- /dev/null +++ b/generated/async/easybill_generated_async/models/pdf_template_settings.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.pdf_template_settings_email import PDFTemplateSettingsEmail +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PDFTemplateSettings(BaseModel): + """ + PDFTemplateSettings + """ # noqa: E501 + text_prefix: Optional[StrictStr] = '' + text: Optional[StrictStr] = '' + email: Optional[PDFTemplateSettingsEmail] = None + __properties: ClassVar[List[str]] = ["text_prefix", "text", "email"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PDFTemplateSettings from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of email + if self.email: + _dict['email'] = self.email.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PDFTemplateSettings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "text_prefix": obj.get("text_prefix") if obj.get("text_prefix") is not None else '', + "text": obj.get("text") if obj.get("text") is not None else '', + "email": PDFTemplateSettingsEmail.from_dict(obj["email"]) if obj.get("email") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/pdf_template_settings_email.py b/generated/async/easybill_generated_async/models/pdf_template_settings_email.py new file mode 100644 index 0000000..f661ec9 --- /dev/null +++ b/generated/async/easybill_generated_async/models/pdf_template_settings_email.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PDFTemplateSettingsEmail(BaseModel): + """ + PDFTemplateSettingsEmail + """ # noqa: E501 + subject: Optional[StrictStr] = '' + message: Optional[StrictStr] = '' + __properties: ClassVar[List[str]] = ["subject", "message"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PDFTemplateSettingsEmail from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PDFTemplateSettingsEmail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "subject": obj.get("subject") if obj.get("subject") is not None else '', + "message": obj.get("message") if obj.get("message") is not None else '' + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/pdf_templates.py b/generated/async/easybill_generated_async/models/pdf_templates.py new file mode 100644 index 0000000..a16648d --- /dev/null +++ b/generated/async/easybill_generated_async/models/pdf_templates.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.pdf_template import PDFTemplate +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PDFTemplates(BaseModel): + """ + PDFTemplates + """ # noqa: E501 + items: Optional[List[PDFTemplate]] = None + __properties: ClassVar[List[str]] = ["items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PDFTemplates from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PDFTemplates from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [PDFTemplate.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/position.py b/generated/async/easybill_generated_async/models/position.py new file mode 100644 index 0000000..21b4e67 --- /dev/null +++ b/generated/async/easybill_generated_async/models/position.py @@ -0,0 +1,287 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from easybill_generated_async.models.position_export_identifier_extended import PositionExportIdentifierExtended +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Position(BaseModel): + """ + Position + """ # noqa: E501 + id: Optional[StrictInt] = None + type: Optional[StrictStr] = 'PRODUCT' + number: StrictStr + description: StrictStr = Field(description="The positions name or description") + document_note: Optional[StrictStr] = Field(default=None, description="This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction.") + note: Optional[StrictStr] = Field(default='null', description="Note for internal use") + unit: Optional[StrictStr] = 'null' + export_identifier: Optional[StrictStr] = Field(default='null', description="The FAS-Account is the four-digit revenue account, in which the revenue will be entered when doing the export to your tax consultant. In case you want to split your revenue to several revenue accounts, please talk to your tax consultant before, to guarantee an unobstructed use of the interface. For every revenue element, there are number ranges, which can be used. Please avoid using combinations of numbers, which can not be used by your tax consultant.") + export_identifier_extended: Optional[PositionExportIdentifierExtended] = None + login_id: Optional[StrictInt] = None + price_type: Optional[StrictStr] = 'NETTO' + vat_percent: Optional[Union[StrictFloat, StrictInt]] = 19.0 + sale_price: Union[StrictFloat, StrictInt] = Field(description="Price in cents (e.g. \"150\" = 1.50€)") + sale_price2: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 2 in cents (e.g. \"150\" = 1.50€)") + sale_price3: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 3 in cents (e.g. \"150\" = 1.50€)") + sale_price4: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 4 in cents (e.g. \"150\" = 1.50€)") + sale_price5: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 5 in cents (e.g. \"150\" = 1.50€)") + sale_price6: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 6 in cents (e.g. \"150\" = 1.50€)") + sale_price7: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 7 in cents (e.g. \"150\" = 1.50€)") + sale_price8: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 8 in cents (e.g. \"150\" = 1.50€)") + sale_price9: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 9 in cents (e.g. \"150\" = 1.50€)") + sale_price10: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 10 in cents (e.g. \"150\" = 1.50€)") + cost_price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents (e.g. \"150\" = 1.50€)") + export_cost1: Optional[StrictStr] = 'null' + export_cost2: Optional[StrictStr] = 'null' + group_id: Optional[StrictInt] = None + stock: Optional[StrictStr] = Field(default='NO', description="Activates stock management for this position") + stock_count: Optional[StrictInt] = Field(default=None, description="Current stock count") + stock_limit_notify: Optional[StrictBool] = Field(default=False, description="Notify when stock_count is lower than stock_limit") + stock_limit_notify_frequency: Optional[StrictStr] = Field(default='ALWAYS', description="Notify frequency when stock_count is lower than stock_limit (ALWAYS, ONCE)") + stock_limit: Optional[StrictInt] = None + quantity: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Used as the default quantity when adding this position to a document") + archived: Optional[StrictBool] = False + __properties: ClassVar[List[str]] = ["id", "type", "number", "description", "document_note", "note", "unit", "export_identifier", "export_identifier_extended", "login_id", "price_type", "vat_percent", "sale_price", "sale_price2", "sale_price3", "sale_price4", "sale_price5", "sale_price6", "sale_price7", "sale_price8", "sale_price9", "sale_price10", "cost_price", "export_cost1", "export_cost2", "group_id", "stock", "stock_count", "stock_limit_notify", "stock_limit_notify_frequency", "stock_limit", "quantity", "archived"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PRODUCT', 'SERVICE', 'TEXT']): + raise ValueError("must be one of enum values ('PRODUCT', 'SERVICE', 'TEXT')") + return value + + @field_validator('price_type') + def price_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['BRUTTO', 'NETTO']): + raise ValueError("must be one of enum values ('BRUTTO', 'NETTO')") + return value + + @field_validator('stock') + def stock_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['YES', 'NO']): + raise ValueError("must be one of enum values ('YES', 'NO')") + return value + + @field_validator('stock_limit_notify_frequency') + def stock_limit_notify_frequency_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ALWAYS', 'ONCE']): + raise ValueError("must be one of enum values ('ALWAYS', 'ONCE')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Position from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "login_id", + "stock_count", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of export_identifier_extended + if self.export_identifier_extended: + _dict['export_identifier_extended'] = self.export_identifier_extended.to_dict() + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if unit (nullable) is None + # and model_fields_set contains the field + if self.unit is None and "unit" in self.model_fields_set: + _dict['unit'] = None + + # set to None if export_identifier (nullable) is None + # and model_fields_set contains the field + if self.export_identifier is None and "export_identifier" in self.model_fields_set: + _dict['export_identifier'] = None + + # set to None if sale_price2 (nullable) is None + # and model_fields_set contains the field + if self.sale_price2 is None and "sale_price2" in self.model_fields_set: + _dict['sale_price2'] = None + + # set to None if sale_price3 (nullable) is None + # and model_fields_set contains the field + if self.sale_price3 is None and "sale_price3" in self.model_fields_set: + _dict['sale_price3'] = None + + # set to None if sale_price4 (nullable) is None + # and model_fields_set contains the field + if self.sale_price4 is None and "sale_price4" in self.model_fields_set: + _dict['sale_price4'] = None + + # set to None if sale_price5 (nullable) is None + # and model_fields_set contains the field + if self.sale_price5 is None and "sale_price5" in self.model_fields_set: + _dict['sale_price5'] = None + + # set to None if sale_price6 (nullable) is None + # and model_fields_set contains the field + if self.sale_price6 is None and "sale_price6" in self.model_fields_set: + _dict['sale_price6'] = None + + # set to None if sale_price7 (nullable) is None + # and model_fields_set contains the field + if self.sale_price7 is None and "sale_price7" in self.model_fields_set: + _dict['sale_price7'] = None + + # set to None if sale_price8 (nullable) is None + # and model_fields_set contains the field + if self.sale_price8 is None and "sale_price8" in self.model_fields_set: + _dict['sale_price8'] = None + + # set to None if sale_price9 (nullable) is None + # and model_fields_set contains the field + if self.sale_price9 is None and "sale_price9" in self.model_fields_set: + _dict['sale_price9'] = None + + # set to None if sale_price10 (nullable) is None + # and model_fields_set contains the field + if self.sale_price10 is None and "sale_price10" in self.model_fields_set: + _dict['sale_price10'] = None + + # set to None if cost_price (nullable) is None + # and model_fields_set contains the field + if self.cost_price is None and "cost_price" in self.model_fields_set: + _dict['cost_price'] = None + + # set to None if export_cost1 (nullable) is None + # and model_fields_set contains the field + if self.export_cost1 is None and "export_cost1" in self.model_fields_set: + _dict['export_cost1'] = None + + # set to None if export_cost2 (nullable) is None + # and model_fields_set contains the field + if self.export_cost2 is None and "export_cost2" in self.model_fields_set: + _dict['export_cost2'] = None + + # set to None if group_id (nullable) is None + # and model_fields_set contains the field + if self.group_id is None and "group_id" in self.model_fields_set: + _dict['group_id'] = None + + # set to None if quantity (nullable) is None + # and model_fields_set contains the field + if self.quantity is None and "quantity" in self.model_fields_set: + _dict['quantity'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Position from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type") if obj.get("type") is not None else 'PRODUCT', + "number": obj.get("number"), + "description": obj.get("description"), + "document_note": obj.get("document_note"), + "note": obj.get("note") if obj.get("note") is not None else 'null', + "unit": obj.get("unit") if obj.get("unit") is not None else 'null', + "export_identifier": obj.get("export_identifier") if obj.get("export_identifier") is not None else 'null', + "export_identifier_extended": PositionExportIdentifierExtended.from_dict(obj["export_identifier_extended"]) if obj.get("export_identifier_extended") is not None else None, + "login_id": obj.get("login_id"), + "price_type": obj.get("price_type") if obj.get("price_type") is not None else 'NETTO', + "vat_percent": obj.get("vat_percent") if obj.get("vat_percent") is not None else 19.0, + "sale_price": obj.get("sale_price"), + "sale_price2": obj.get("sale_price2"), + "sale_price3": obj.get("sale_price3"), + "sale_price4": obj.get("sale_price4"), + "sale_price5": obj.get("sale_price5"), + "sale_price6": obj.get("sale_price6"), + "sale_price7": obj.get("sale_price7"), + "sale_price8": obj.get("sale_price8"), + "sale_price9": obj.get("sale_price9"), + "sale_price10": obj.get("sale_price10"), + "cost_price": obj.get("cost_price"), + "export_cost1": obj.get("export_cost1") if obj.get("export_cost1") is not None else 'null', + "export_cost2": obj.get("export_cost2") if obj.get("export_cost2") is not None else 'null', + "group_id": obj.get("group_id"), + "stock": obj.get("stock") if obj.get("stock") is not None else 'NO', + "stock_count": obj.get("stock_count"), + "stock_limit_notify": obj.get("stock_limit_notify") if obj.get("stock_limit_notify") is not None else False, + "stock_limit_notify_frequency": obj.get("stock_limit_notify_frequency") if obj.get("stock_limit_notify_frequency") is not None else 'ALWAYS', + "stock_limit": obj.get("stock_limit"), + "quantity": obj.get("quantity"), + "archived": obj.get("archived") if obj.get("archived") is not None else False + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/position_export_identifier_extended.py b/generated/async/easybill_generated_async/models/position_export_identifier_extended.py new file mode 100644 index 0000000..daa0d39 --- /dev/null +++ b/generated/async/easybill_generated_async/models/position_export_identifier_extended.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PositionExportIdentifierExtended(BaseModel): + """ + PositionExportIdentifierExtended + """ # noqa: E501 + null: Optional[StrictStr] = Field(default='null', description="Umsatzsteuerpflichtig", alias="NULL") + n_stb: Optional[StrictStr] = Field(default='null', description="Nicht steuerbar (Drittland)", alias="nStb") + n_stb_ust_id: Optional[StrictStr] = Field(default='null', description="Nicht steuerbar (EU mit USt-IdNr.)", alias="nStbUstID") + n_stb_none_ust_id: Optional[StrictStr] = Field(default='null', description="Nicht steuerbar (EU ohne USt-IdNr.)", alias="nStbNoneUstID") + n_stb_im: Optional[StrictStr] = Field(default='null', description="Nicht steuerbarer Innenumsatz", alias="nStbIm") + revc: Optional[StrictStr] = Field(default='null', description="Steuerschuldwechsel §13b (Inland)") + ig: Optional[StrictStr] = Field(default='null', description="Innergemeinschaftliche Lieferung", alias="IG") + al: Optional[StrictStr] = Field(default='null', description="Ausfuhrlieferung", alias="AL") + s_stfr: Optional[StrictStr] = Field(default='null', description="sonstige Steuerbefreiung", alias="sStfr") + small_business: Optional[StrictStr] = Field(default='null', description="Kleinunternehmen (Keine MwSt.)", alias="smallBusiness") + __properties: ClassVar[List[str]] = ["NULL", "nStb", "nStbUstID", "nStbNoneUstID", "nStbIm", "revc", "IG", "AL", "sStfr", "smallBusiness"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PositionExportIdentifierExtended from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if null (nullable) is None + # and model_fields_set contains the field + if self.null is None and "null" in self.model_fields_set: + _dict['NULL'] = None + + # set to None if n_stb (nullable) is None + # and model_fields_set contains the field + if self.n_stb is None and "n_stb" in self.model_fields_set: + _dict['nStb'] = None + + # set to None if n_stb_ust_id (nullable) is None + # and model_fields_set contains the field + if self.n_stb_ust_id is None and "n_stb_ust_id" in self.model_fields_set: + _dict['nStbUstID'] = None + + # set to None if n_stb_none_ust_id (nullable) is None + # and model_fields_set contains the field + if self.n_stb_none_ust_id is None and "n_stb_none_ust_id" in self.model_fields_set: + _dict['nStbNoneUstID'] = None + + # set to None if n_stb_im (nullable) is None + # and model_fields_set contains the field + if self.n_stb_im is None and "n_stb_im" in self.model_fields_set: + _dict['nStbIm'] = None + + # set to None if revc (nullable) is None + # and model_fields_set contains the field + if self.revc is None and "revc" in self.model_fields_set: + _dict['revc'] = None + + # set to None if ig (nullable) is None + # and model_fields_set contains the field + if self.ig is None and "ig" in self.model_fields_set: + _dict['IG'] = None + + # set to None if al (nullable) is None + # and model_fields_set contains the field + if self.al is None and "al" in self.model_fields_set: + _dict['AL'] = None + + # set to None if s_stfr (nullable) is None + # and model_fields_set contains the field + if self.s_stfr is None and "s_stfr" in self.model_fields_set: + _dict['sStfr'] = None + + # set to None if small_business (nullable) is None + # and model_fields_set contains the field + if self.small_business is None and "small_business" in self.model_fields_set: + _dict['smallBusiness'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PositionExportIdentifierExtended from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "NULL": obj.get("NULL") if obj.get("NULL") is not None else 'null', + "nStb": obj.get("nStb") if obj.get("nStb") is not None else 'null', + "nStbUstID": obj.get("nStbUstID") if obj.get("nStbUstID") is not None else 'null', + "nStbNoneUstID": obj.get("nStbNoneUstID") if obj.get("nStbNoneUstID") is not None else 'null', + "nStbIm": obj.get("nStbIm") if obj.get("nStbIm") is not None else 'null', + "revc": obj.get("revc") if obj.get("revc") is not None else 'null', + "IG": obj.get("IG") if obj.get("IG") is not None else 'null', + "AL": obj.get("AL") if obj.get("AL") is not None else 'null', + "sStfr": obj.get("sStfr") if obj.get("sStfr") is not None else 'null', + "smallBusiness": obj.get("smallBusiness") if obj.get("smallBusiness") is not None else 'null' + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/position_group.py b/generated/async/easybill_generated_async/models/position_group.py new file mode 100644 index 0000000..469ea46 --- /dev/null +++ b/generated/async/easybill_generated_async/models/position_group.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PositionGroup(BaseModel): + """ + PositionGroup + """ # noqa: E501 + description: Optional[StrictStr] = 'null' + login_id: Optional[StrictInt] = None + name: StrictStr + number: StrictStr + display_name: Optional[StrictStr] = None + id: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["description", "login_id", "name", "number", "display_name", "id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PositionGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "login_id", + "display_name", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PositionGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description") if obj.get("description") is not None else 'null', + "login_id": obj.get("login_id"), + "name": obj.get("name"), + "number": obj.get("number"), + "display_name": obj.get("display_name"), + "id": obj.get("id") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/position_groups.py b/generated/async/easybill_generated_async/models/position_groups.py new file mode 100644 index 0000000..e57cf3a --- /dev/null +++ b/generated/async/easybill_generated_async/models/position_groups.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.position_group import PositionGroup +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PositionGroups(BaseModel): + """ + PositionGroups + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[PositionGroup]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PositionGroups from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PositionGroups from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [PositionGroup.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/positions.py b/generated/async/easybill_generated_async/models/positions.py new file mode 100644 index 0000000..ccd9fd3 --- /dev/null +++ b/generated/async/easybill_generated_async/models/positions.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.position import Position +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Positions(BaseModel): + """ + Positions + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Position]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Positions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Positions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Position.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/post_box.py b/generated/async/easybill_generated_async/models/post_box.py new file mode 100644 index 0000000..ca857d2 --- /dev/null +++ b/generated/async/easybill_generated_async/models/post_box.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PostBox(BaseModel): + """ + PostBox + """ # noqa: E501 + id: Optional[StrictInt] = None + document_id: Optional[StrictInt] = None + to: Optional[StrictStr] = None + cc: Optional[StrictStr] = None + var_from: Optional[StrictStr] = Field(default=None, alias="from") + subject: Optional[StrictStr] = None + message: Optional[StrictStr] = None + var_date: Optional[date] = Field(default=None, alias="date") + created_at: Optional[datetime] = None + processed_at: Optional[datetime] = None + send_by_self: Optional[StrictBool] = None + send_with_attachment: Optional[StrictBool] = None + type: Optional[StrictStr] = None + status: Optional[StrictStr] = None + status_msg: Optional[StrictStr] = None + login_id: Optional[StrictInt] = None + document_file_type: Optional[StrictStr] = None + post_send_type: Optional[StrictStr] = Field(default=None, description="This value indicates what method is used when the document is send via mail. The different types are offered by the german post as additional services. The registered mail options will include a tracking number which will be added to the postbox when known. If the value is omitted or empty when a postbox is created with the type \"POST\" post_send_type_standard will be used. For postbox with a different type than \"POST\" this field will hold a empty string. ") + tracking_identifier: Optional[StrictStr] = Field(default=None, description="If the document is send with one of the registered send types stated for post_send_type, a tracking identifier will be added to the postbox at a later point when the tracking identifier is provided by our service partner. ") + __properties: ClassVar[List[str]] = ["id", "document_id", "to", "cc", "from", "subject", "message", "date", "created_at", "processed_at", "send_by_self", "send_with_attachment", "type", "status", "status_msg", "login_id", "document_file_type", "post_send_type", "tracking_identifier"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['FAX', 'EMAIL', 'POST']): + raise ValueError("must be one of enum values ('FAX', 'EMAIL', 'POST')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['WAITING', 'PREPARE', 'ERROR', 'OK', 'PROCESSING']): + raise ValueError("must be one of enum values ('WAITING', 'PREPARE', 'ERROR', 'OK', 'PROCESSING')") + return value + + @field_validator('document_file_type') + def document_file_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung', 'xrechnung_xml']): + raise ValueError("must be one of enum values ('default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung', 'xrechnung_xml')") + return value + + @field_validator('post_send_type') + def post_send_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['post_send_type_standard', 'post_send_type_registered', 'post_send_type_registered_and_personal', 'post_send_type_registered_and_receipt', 'post_send_type_registered_throwin', 'post_send_type_prio']): + raise ValueError("must be one of enum values ('post_send_type_standard', 'post_send_type_registered', 'post_send_type_registered_and_personal', 'post_send_type_registered_and_receipt', 'post_send_type_registered_throwin', 'post_send_type_prio')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PostBox from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "login_id", + "tracking_identifier", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if document_file_type (nullable) is None + # and model_fields_set contains the field + if self.document_file_type is None and "document_file_type" in self.model_fields_set: + _dict['document_file_type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PostBox from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "document_id": obj.get("document_id"), + "to": obj.get("to"), + "cc": obj.get("cc"), + "from": obj.get("from"), + "subject": obj.get("subject"), + "message": obj.get("message"), + "date": obj.get("date"), + "created_at": obj.get("created_at"), + "processed_at": obj.get("processed_at"), + "send_by_self": obj.get("send_by_self"), + "send_with_attachment": obj.get("send_with_attachment"), + "type": obj.get("type"), + "status": obj.get("status"), + "status_msg": obj.get("status_msg"), + "login_id": obj.get("login_id"), + "document_file_type": obj.get("document_file_type"), + "post_send_type": obj.get("post_send_type"), + "tracking_identifier": obj.get("tracking_identifier") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/post_box_request.py b/generated/async/easybill_generated_async/models/post_box_request.py new file mode 100644 index 0000000..3db4318 --- /dev/null +++ b/generated/async/easybill_generated_async/models/post_box_request.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PostBoxRequest(BaseModel): + """ + PostBoxRequest + """ # noqa: E501 + to: Optional[StrictStr] = None + cc: Optional[StrictStr] = None + var_from: Optional[StrictStr] = Field(default=None, alias="from") + subject: Optional[StrictStr] = None + message: Optional[StrictStr] = None + var_date: Optional[date] = Field(default=None, alias="date") + send_by_self: Optional[StrictBool] = None + send_with_attachment: Optional[StrictBool] = True + document_file_type: Optional[StrictStr] = Field(default=None, description="When set to null, the setting on the customer is used") + post_send_type: Optional[StrictStr] = Field(default=None, description="This value indicates what method is used when the document is send via mail. The different types are offered by the german post as additional services. The registered mail options will include a tracking number which will be added to the postbox when known. If the value is omitted or empty when a postbox is created with the type \"POST\" post_send_type_standard will be used. For postbox with a different type than \"POST\" this field will hold a empty string. ") + __properties: ClassVar[List[str]] = ["to", "cc", "from", "subject", "message", "date", "send_by_self", "send_with_attachment", "document_file_type", "post_send_type"] + + @field_validator('document_file_type') + def document_file_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung', 'xrechnung_xml', 'xrechnung2_2_xml', 'xrechnung3_0_xml']): + raise ValueError("must be one of enum values ('default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung', 'xrechnung_xml', 'xrechnung2_2_xml', 'xrechnung3_0_xml')") + return value + + @field_validator('post_send_type') + def post_send_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['post_send_type_standard', 'post_send_type_registered', 'post_send_type_registered_and_personal', 'post_send_type_registered_and_receipt', 'post_send_type_registered_throwin']): + raise ValueError("must be one of enum values ('post_send_type_standard', 'post_send_type_registered', 'post_send_type_registered_and_personal', 'post_send_type_registered_and_receipt', 'post_send_type_registered_throwin')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PostBoxRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if document_file_type (nullable) is None + # and model_fields_set contains the field + if self.document_file_type is None and "document_file_type" in self.model_fields_set: + _dict['document_file_type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PostBoxRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "to": obj.get("to"), + "cc": obj.get("cc"), + "from": obj.get("from"), + "subject": obj.get("subject"), + "message": obj.get("message"), + "date": obj.get("date"), + "send_by_self": obj.get("send_by_self"), + "send_with_attachment": obj.get("send_with_attachment") if obj.get("send_with_attachment") is not None else True, + "document_file_type": obj.get("document_file_type"), + "post_send_type": obj.get("post_send_type") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/post_boxes.py b/generated/async/easybill_generated_async/models/post_boxes.py new file mode 100644 index 0000000..225efb1 --- /dev/null +++ b/generated/async/easybill_generated_async/models/post_boxes.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.post_box import PostBox +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PostBoxes(BaseModel): + """ + PostBoxes + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[PostBox]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PostBoxes from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PostBoxes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [PostBox.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/project.py b/generated/async/easybill_generated_async/models/project.py new file mode 100644 index 0000000..831025b --- /dev/null +++ b/generated/async/easybill_generated_async/models/project.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Project(BaseModel): + """ + Project + """ # noqa: E501 + budget_amount: Optional[StrictInt] = Field(default=None, description="Project budget in cents (e.g. \"150\" = 1.50€)") + budget_time: Optional[StrictInt] = Field(default=None, description="Time budget in minutes (e.g. \"90\" = 1 hour and 30 minutes)") + customer_id: Optional[StrictInt] = None + hourly_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Hourly rate in cents (e.g. \"150\" = 1.50€)") + id: Optional[StrictInt] = None + login_id: Optional[StrictInt] = Field(default=None, description="If omitted or null, the currently active login is used") + name: StrictStr + note: Optional[StrictStr] = 'null' + status: Optional[StrictStr] = 'OPEN' + due_at: Optional[date] = None + budget_notify_frequency: Optional[StrictStr] = 'ALWAYS' + consumed_time: Optional[StrictInt] = None + consumed_amount: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["budget_amount", "budget_time", "customer_id", "hourly_rate", "id", "login_id", "name", "note", "status", "due_at", "budget_notify_frequency", "consumed_time", "consumed_amount"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['OPEN', 'DONE', 'CANCEL']): + raise ValueError("must be one of enum values ('OPEN', 'DONE', 'CANCEL')") + return value + + @field_validator('budget_notify_frequency') + def budget_notify_frequency_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ALWAYS', 'ONCE', 'NEVER']): + raise ValueError("must be one of enum values ('ALWAYS', 'ONCE', 'NEVER')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Project from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "consumed_time", + "consumed_amount", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if customer_id (nullable) is None + # and model_fields_set contains the field + if self.customer_id is None and "customer_id" in self.model_fields_set: + _dict['customer_id'] = None + + # set to None if login_id (nullable) is None + # and model_fields_set contains the field + if self.login_id is None and "login_id" in self.model_fields_set: + _dict['login_id'] = None + + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if due_at (nullable) is None + # and model_fields_set contains the field + if self.due_at is None and "due_at" in self.model_fields_set: + _dict['due_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Project from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "budget_amount": obj.get("budget_amount"), + "budget_time": obj.get("budget_time"), + "customer_id": obj.get("customer_id"), + "hourly_rate": obj.get("hourly_rate"), + "id": obj.get("id"), + "login_id": obj.get("login_id"), + "name": obj.get("name"), + "note": obj.get("note") if obj.get("note") is not None else 'null', + "status": obj.get("status") if obj.get("status") is not None else 'OPEN', + "due_at": obj.get("due_at"), + "budget_notify_frequency": obj.get("budget_notify_frequency") if obj.get("budget_notify_frequency") is not None else 'ALWAYS', + "consumed_time": obj.get("consumed_time"), + "consumed_amount": obj.get("consumed_amount") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/projects.py b/generated/async/easybill_generated_async/models/projects.py new file mode 100644 index 0000000..b90f1bf --- /dev/null +++ b/generated/async/easybill_generated_async/models/projects.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.project import Project +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Projects(BaseModel): + """ + Projects + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Project]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Projects from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Projects from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Project.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/sepa_payment.py b/generated/async/easybill_generated_async/models/sepa_payment.py new file mode 100644 index 0000000..794cd9b --- /dev/null +++ b/generated/async/easybill_generated_async/models/sepa_payment.py @@ -0,0 +1,208 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SEPAPayment(BaseModel): + """ + SEPAPayment + """ # noqa: E501 + amount: StrictInt = Field(description="Amount in cents (e.g. \"150\" = 1.50€)") + created_at: Optional[datetime] = None + creditor_bic: Optional[StrictStr] = Field(default='null', description="If type is DEBIT, this field is overwritten with the selected bank account data on export.") + creditor_iban: Optional[StrictStr] = Field(default=None, description="Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export.") + creditor_name: Optional[StrictStr] = Field(default=None, description="Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export.") + debitor_bic: Optional[StrictStr] = Field(default='null', description="If type is CREDIT, this field is overwritten with the selected bank account data on export.") + debitor_iban: Optional[StrictStr] = Field(description="Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export.") + debitor_name: Optional[StrictStr] = Field(description="Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export.") + debitor_address_line_1: Optional[Annotated[str, Field(strict=True, max_length=70)]] = Field(default=None, description="Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA") + debitor_address_line2: Optional[Annotated[str, Field(strict=True, max_length=70)]] = Field(default=None, description="string") + debitor_country: Optional[Annotated[str, Field(strict=True, max_length=2)]] = Field(default=None, description="Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA") + document_id: StrictInt + export_at: Optional[datetime] = Field(default=None, description="If a date is set, this record is marked as exported") + export_error: Optional[StrictStr] = None + id: Optional[StrictInt] = None + local_instrument: StrictStr = Field(description="CORE: SEPA Core Direct Debit
COR1: SEPA-Basislastschrift COR1 (deprecated use CORE instead)
B2B: SEPA Business to Business Direct Debit") + mandate_date_of_signature: date + mandate_id: Annotated[str, Field(strict=True, max_length=34)] + reference: Annotated[str, Field(strict=True, max_length=35)] + remittance_information: Optional[Annotated[str, Field(strict=True, max_length=140)]] = 'null' + requested_at: Optional[date] = Field(default=None, description="Booking date") + sequence_type: StrictStr = Field(description="FRST: Erstlastschrift
RCUR: Folgelastschrift
OOFF: Einmallastschrift
FNAL: Letztmalige Lastschrift") + updated_at: Optional[StrictStr] = None + type: Optional[StrictStr] = 'DEBIT' + __properties: ClassVar[List[str]] = ["amount", "created_at", "creditor_bic", "creditor_iban", "creditor_name", "debitor_bic", "debitor_iban", "debitor_name", "debitor_address_line_1", "debitor_address_line2", "debitor_country", "document_id", "export_at", "export_error", "id", "local_instrument", "mandate_date_of_signature", "mandate_id", "reference", "remittance_information", "requested_at", "sequence_type", "updated_at", "type"] + + @field_validator('local_instrument') + def local_instrument_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CORE', 'COR1', 'B2B']): + raise ValueError("must be one of enum values ('CORE', 'COR1', 'B2B')") + return value + + @field_validator('sequence_type') + def sequence_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['FRST', 'OOFF', 'FNAL', 'RCUR']): + raise ValueError("must be one of enum values ('FRST', 'OOFF', 'FNAL', 'RCUR')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['DEBIT', 'CREDIT']): + raise ValueError("must be one of enum values ('DEBIT', 'CREDIT')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SEPAPayment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "export_error", + "id", + "updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if creditor_bic (nullable) is None + # and model_fields_set contains the field + if self.creditor_bic is None and "creditor_bic" in self.model_fields_set: + _dict['creditor_bic'] = None + + # set to None if creditor_iban (nullable) is None + # and model_fields_set contains the field + if self.creditor_iban is None and "creditor_iban" in self.model_fields_set: + _dict['creditor_iban'] = None + + # set to None if creditor_name (nullable) is None + # and model_fields_set contains the field + if self.creditor_name is None and "creditor_name" in self.model_fields_set: + _dict['creditor_name'] = None + + # set to None if debitor_bic (nullable) is None + # and model_fields_set contains the field + if self.debitor_bic is None and "debitor_bic" in self.model_fields_set: + _dict['debitor_bic'] = None + + # set to None if debitor_iban (nullable) is None + # and model_fields_set contains the field + if self.debitor_iban is None and "debitor_iban" in self.model_fields_set: + _dict['debitor_iban'] = None + + # set to None if debitor_name (nullable) is None + # and model_fields_set contains the field + if self.debitor_name is None and "debitor_name" in self.model_fields_set: + _dict['debitor_name'] = None + + # set to None if export_at (nullable) is None + # and model_fields_set contains the field + if self.export_at is None and "export_at" in self.model_fields_set: + _dict['export_at'] = None + + # set to None if remittance_information (nullable) is None + # and model_fields_set contains the field + if self.remittance_information is None and "remittance_information" in self.model_fields_set: + _dict['remittance_information'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SEPAPayment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "amount": obj.get("amount"), + "created_at": obj.get("created_at"), + "creditor_bic": obj.get("creditor_bic") if obj.get("creditor_bic") is not None else 'null', + "creditor_iban": obj.get("creditor_iban"), + "creditor_name": obj.get("creditor_name"), + "debitor_bic": obj.get("debitor_bic") if obj.get("debitor_bic") is not None else 'null', + "debitor_iban": obj.get("debitor_iban"), + "debitor_name": obj.get("debitor_name"), + "debitor_address_line_1": obj.get("debitor_address_line_1"), + "debitor_address_line2": obj.get("debitor_address_line2"), + "debitor_country": obj.get("debitor_country"), + "document_id": obj.get("document_id"), + "export_at": obj.get("export_at"), + "export_error": obj.get("export_error"), + "id": obj.get("id"), + "local_instrument": obj.get("local_instrument"), + "mandate_date_of_signature": obj.get("mandate_date_of_signature"), + "mandate_id": obj.get("mandate_id"), + "reference": obj.get("reference"), + "remittance_information": obj.get("remittance_information") if obj.get("remittance_information") is not None else 'null', + "requested_at": obj.get("requested_at"), + "sequence_type": obj.get("sequence_type"), + "updated_at": obj.get("updated_at"), + "type": obj.get("type") if obj.get("type") is not None else 'DEBIT' + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/sepa_payments.py b/generated/async/easybill_generated_async/models/sepa_payments.py new file mode 100644 index 0000000..cd3f450 --- /dev/null +++ b/generated/async/easybill_generated_async/models/sepa_payments.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.sepa_payment import SEPAPayment +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SEPAPayments(BaseModel): + """ + SEPAPayments + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[SEPAPayment]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SEPAPayments from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SEPAPayments from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [SEPAPayment.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/serial_number.py b/generated/async/easybill_generated_async/models/serial_number.py new file mode 100644 index 0000000..dc9d9a8 --- /dev/null +++ b/generated/async/easybill_generated_async/models/serial_number.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SerialNumber(BaseModel): + """ + SerialNumber + """ # noqa: E501 + id: Optional[StrictInt] = None + serial_number: StrictStr + position_id: StrictInt + document_id: Optional[StrictInt] = None + document_position_id: Optional[StrictInt] = None + used_at: Optional[StrictStr] = None + created_at: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "serial_number", "position_id", "document_id", "document_position_id", "used_at", "created_at"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SerialNumber from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "document_id", + "document_position_id", + "used_at", + "created_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if document_id (nullable) is None + # and model_fields_set contains the field + if self.document_id is None and "document_id" in self.model_fields_set: + _dict['document_id'] = None + + # set to None if document_position_id (nullable) is None + # and model_fields_set contains the field + if self.document_position_id is None and "document_position_id" in self.model_fields_set: + _dict['document_position_id'] = None + + # set to None if used_at (nullable) is None + # and model_fields_set contains the field + if self.used_at is None and "used_at" in self.model_fields_set: + _dict['used_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SerialNumber from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "serial_number": obj.get("serial_number"), + "position_id": obj.get("position_id"), + "document_id": obj.get("document_id"), + "document_position_id": obj.get("document_position_id"), + "used_at": obj.get("used_at"), + "created_at": obj.get("created_at") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/serial_numbers.py b/generated/async/easybill_generated_async/models/serial_numbers.py new file mode 100644 index 0000000..cd8cfc4 --- /dev/null +++ b/generated/async/easybill_generated_async/models/serial_numbers.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.serial_number import SerialNumber +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SerialNumbers(BaseModel): + """ + SerialNumbers + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[SerialNumber]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SerialNumbers from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SerialNumbers from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [SerialNumber.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/service_date.py b/generated/async/easybill_generated_async/models/service_date.py new file mode 100644 index 0000000..21b2e9f --- /dev/null +++ b/generated/async/easybill_generated_async/models/service_date.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ServiceDate(BaseModel): + """ + This object is only available in document type INVOICE or CREDIT. + """ # noqa: E501 + type: Optional[StrictStr] = Field(default=None, description="With DEFAULT no other fields are required and this message will be printed: 'Invoice date coincides with the time of supply'.
For SERVICE or DELIVERY exactly one of the following fields must be set: date, date_from and date_to or text.") + var_date: Optional[date] = Field(default=None, alias="date") + date_from: Optional[date] = None + date_to: Optional[date] = None + text: Optional[StrictStr] = 'null' + __properties: ClassVar[List[str]] = ["type", "date", "date_from", "date_to", "text"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['DEFAULT', 'SERVICE', 'DELIVERY']): + raise ValueError("must be one of enum values ('DEFAULT', 'SERVICE', 'DELIVERY')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ServiceDate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if var_date (nullable) is None + # and model_fields_set contains the field + if self.var_date is None and "var_date" in self.model_fields_set: + _dict['date'] = None + + # set to None if date_from (nullable) is None + # and model_fields_set contains the field + if self.date_from is None and "date_from" in self.model_fields_set: + _dict['date_from'] = None + + # set to None if date_to (nullable) is None + # and model_fields_set contains the field + if self.date_to is None and "date_to" in self.model_fields_set: + _dict['date_to'] = None + + # set to None if text (nullable) is None + # and model_fields_set contains the field + if self.text is None and "text" in self.model_fields_set: + _dict['text'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ServiceDate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "date": obj.get("date"), + "date_from": obj.get("date_from"), + "date_to": obj.get("date_to"), + "text": obj.get("text") if obj.get("text") is not None else 'null' + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/stock.py b/generated/async/easybill_generated_async/models/stock.py new file mode 100644 index 0000000..6b6c660 --- /dev/null +++ b/generated/async/easybill_generated_async/models/stock.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Stock(BaseModel): + """ + Stock + """ # noqa: E501 + id: Optional[StrictInt] = None + note: Optional[StrictStr] = None + stock_count: StrictInt + position_id: StrictInt + document_id: Optional[StrictInt] = None + document_position_id: Optional[StrictInt] = None + stored_at: Optional[StrictStr] = None + created_at: Optional[StrictStr] = None + updated_at: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "note", "stock_count", "position_id", "document_id", "document_position_id", "stored_at", "created_at", "updated_at"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Stock from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "document_id", + "document_position_id", + "created_at", + "updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if document_id (nullable) is None + # and model_fields_set contains the field + if self.document_id is None and "document_id" in self.model_fields_set: + _dict['document_id'] = None + + # set to None if document_position_id (nullable) is None + # and model_fields_set contains the field + if self.document_position_id is None and "document_position_id" in self.model_fields_set: + _dict['document_position_id'] = None + + # set to None if stored_at (nullable) is None + # and model_fields_set contains the field + if self.stored_at is None and "stored_at" in self.model_fields_set: + _dict['stored_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Stock from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "note": obj.get("note"), + "stock_count": obj.get("stock_count"), + "position_id": obj.get("position_id"), + "document_id": obj.get("document_id"), + "document_position_id": obj.get("document_position_id"), + "stored_at": obj.get("stored_at"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/stocks.py b/generated/async/easybill_generated_async/models/stocks.py new file mode 100644 index 0000000..2b4c499 --- /dev/null +++ b/generated/async/easybill_generated_async/models/stocks.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.stock import Stock +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Stocks(BaseModel): + """ + Stocks + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Stock]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Stocks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Stocks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Stock.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/task.py b/generated/async/easybill_generated_async/models/task.py new file mode 100644 index 0000000..84a2781 --- /dev/null +++ b/generated/async/easybill_generated_async/models/task.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Task(BaseModel): + """ + Task + """ # noqa: E501 + category: Optional[StrictStr] = null + category_custom: Optional[StrictStr] = Field(default='null', description="The name of your custom category. Can only have a value if \"category\" is \"CUSTOM\".") + created_at: Optional[datetime] = None + customer_id: Optional[StrictInt] = None + description: Optional[StrictStr] = 'null' + document_id: Optional[StrictInt] = None + end_at: Optional[datetime] = Field(default=None, description="The deadline") + finish_at: Optional[datetime] = Field(default=None, description="The time when the task was marked as done") + id: Optional[StrictInt] = None + login_id: Optional[StrictInt] = Field(default=None, description="When omitted or null, the currently active login is used") + name: StrictStr + position_id: Optional[StrictInt] = None + priority: Optional[StrictStr] = 'NORMAL' + project_id: Optional[StrictInt] = None + start_at: Optional[datetime] = None + status: StrictStr + status_percent: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["category", "category_custom", "created_at", "customer_id", "description", "document_id", "end_at", "finish_at", "id", "login_id", "name", "position_id", "priority", "project_id", "start_at", "status", "status_percent"] + + @field_validator('category') + def category_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['CALL', 'EMAIL', 'FAX', 'LUNCH', 'MEETING', 'TRAVEL', 'CUSTOM']): + raise ValueError("must be one of enum values ('CALL', 'EMAIL', 'FAX', 'LUNCH', 'MEETING', 'TRAVEL', 'CUSTOM')") + return value + + @field_validator('priority') + def priority_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['LOW', 'NORMAL', 'HIGH']): + raise ValueError("must be one of enum values ('LOW', 'NORMAL', 'HIGH')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['WAITING', 'PROCESSING', 'DONE', 'CANCEL']): + raise ValueError("must be one of enum values ('WAITING', 'PROCESSING', 'DONE', 'CANCEL')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Task from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "finish_at", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if category (nullable) is None + # and model_fields_set contains the field + if self.category is None and "category" in self.model_fields_set: + _dict['category'] = None + + # set to None if category_custom (nullable) is None + # and model_fields_set contains the field + if self.category_custom is None and "category_custom" in self.model_fields_set: + _dict['category_custom'] = None + + # set to None if customer_id (nullable) is None + # and model_fields_set contains the field + if self.customer_id is None and "customer_id" in self.model_fields_set: + _dict['customer_id'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if document_id (nullable) is None + # and model_fields_set contains the field + if self.document_id is None and "document_id" in self.model_fields_set: + _dict['document_id'] = None + + # set to None if end_at (nullable) is None + # and model_fields_set contains the field + if self.end_at is None and "end_at" in self.model_fields_set: + _dict['end_at'] = None + + # set to None if finish_at (nullable) is None + # and model_fields_set contains the field + if self.finish_at is None and "finish_at" in self.model_fields_set: + _dict['finish_at'] = None + + # set to None if login_id (nullable) is None + # and model_fields_set contains the field + if self.login_id is None and "login_id" in self.model_fields_set: + _dict['login_id'] = None + + # set to None if position_id (nullable) is None + # and model_fields_set contains the field + if self.position_id is None and "position_id" in self.model_fields_set: + _dict['position_id'] = None + + # set to None if project_id (nullable) is None + # and model_fields_set contains the field + if self.project_id is None and "project_id" in self.model_fields_set: + _dict['project_id'] = None + + # set to None if start_at (nullable) is None + # and model_fields_set contains the field + if self.start_at is None and "start_at" in self.model_fields_set: + _dict['start_at'] = None + + # set to None if status_percent (nullable) is None + # and model_fields_set contains the field + if self.status_percent is None and "status_percent" in self.model_fields_set: + _dict['status_percent'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Task from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category": obj.get("category") if obj.get("category") is not None else null, + "category_custom": obj.get("category_custom") if obj.get("category_custom") is not None else 'null', + "created_at": obj.get("created_at"), + "customer_id": obj.get("customer_id"), + "description": obj.get("description") if obj.get("description") is not None else 'null', + "document_id": obj.get("document_id"), + "end_at": obj.get("end_at"), + "finish_at": obj.get("finish_at"), + "id": obj.get("id"), + "login_id": obj.get("login_id"), + "name": obj.get("name"), + "position_id": obj.get("position_id"), + "priority": obj.get("priority") if obj.get("priority") is not None else 'NORMAL', + "project_id": obj.get("project_id"), + "start_at": obj.get("start_at"), + "status": obj.get("status"), + "status_percent": obj.get("status_percent") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/tasks.py b/generated/async/easybill_generated_async/models/tasks.py new file mode 100644 index 0000000..6a71fbd --- /dev/null +++ b/generated/async/easybill_generated_async/models/tasks.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.task import Task +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Tasks(BaseModel): + """ + Tasks + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Task]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Tasks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Tasks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Task.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/text_template.py b/generated/async/easybill_generated_async/models/text_template.py new file mode 100644 index 0000000..d7928f7 --- /dev/null +++ b/generated/async/easybill_generated_async/models/text_template.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TextTemplate(BaseModel): + """ + TextTemplate + """ # noqa: E501 + can_modify: Optional[StrictBool] = Field(default=None, description="Deprecated, field is always true.") + id: Optional[StrictInt] = None + text: StrictStr + title: StrictStr + __properties: ClassVar[List[str]] = ["can_modify", "id", "text", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TextTemplate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "can_modify", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TextTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "can_modify": obj.get("can_modify"), + "id": obj.get("id"), + "text": obj.get("text"), + "title": obj.get("title") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/text_templates.py b/generated/async/easybill_generated_async/models/text_templates.py new file mode 100644 index 0000000..25fad9c --- /dev/null +++ b/generated/async/easybill_generated_async/models/text_templates.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.text_template import TextTemplate +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TextTemplates(BaseModel): + """ + TextTemplates + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[TextTemplate]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TextTemplates from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TextTemplates from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [TextTemplate.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/time_tracking.py b/generated/async/easybill_generated_async/models/time_tracking.py new file mode 100644 index 0000000..c2bcd00 --- /dev/null +++ b/generated/async/easybill_generated_async/models/time_tracking.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TimeTracking(BaseModel): + """ + TimeTracking + """ # noqa: E501 + cleared_at: Optional[datetime] = None + created_at: Optional[datetime] = None + date_from_at: Optional[datetime] = None + date_thru_at: Optional[datetime] = None + description: StrictStr + hourly_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=0.0, description="Hourly rate in cents (e.g. \"150\" = 1.50€)") + id: Optional[StrictInt] = None + note: Optional[StrictStr] = 'null' + number: Optional[StrictStr] = Field(default=None, description="Can be chosen freely") + position_id: Optional[StrictInt] = None + project_id: Optional[StrictInt] = None + login_id: Optional[StrictInt] = Field(default=None, description="If omitted or null, the currently active login is used.") + timer_value: Optional[StrictInt] = Field(default=None, description="Tracked time in minutes") + __properties: ClassVar[List[str]] = ["cleared_at", "created_at", "date_from_at", "date_thru_at", "description", "hourly_rate", "id", "note", "number", "position_id", "project_id", "login_id", "timer_value"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TimeTracking from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if cleared_at (nullable) is None + # and model_fields_set contains the field + if self.cleared_at is None and "cleared_at" in self.model_fields_set: + _dict['cleared_at'] = None + + # set to None if date_from_at (nullable) is None + # and model_fields_set contains the field + if self.date_from_at is None and "date_from_at" in self.model_fields_set: + _dict['date_from_at'] = None + + # set to None if date_thru_at (nullable) is None + # and model_fields_set contains the field + if self.date_thru_at is None and "date_thru_at" in self.model_fields_set: + _dict['date_thru_at'] = None + + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if number (nullable) is None + # and model_fields_set contains the field + if self.number is None and "number" in self.model_fields_set: + _dict['number'] = None + + # set to None if position_id (nullable) is None + # and model_fields_set contains the field + if self.position_id is None and "position_id" in self.model_fields_set: + _dict['position_id'] = None + + # set to None if project_id (nullable) is None + # and model_fields_set contains the field + if self.project_id is None and "project_id" in self.model_fields_set: + _dict['project_id'] = None + + # set to None if login_id (nullable) is None + # and model_fields_set contains the field + if self.login_id is None and "login_id" in self.model_fields_set: + _dict['login_id'] = None + + # set to None if timer_value (nullable) is None + # and model_fields_set contains the field + if self.timer_value is None and "timer_value" in self.model_fields_set: + _dict['timer_value'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TimeTracking from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cleared_at": obj.get("cleared_at"), + "created_at": obj.get("created_at"), + "date_from_at": obj.get("date_from_at"), + "date_thru_at": obj.get("date_thru_at"), + "description": obj.get("description"), + "hourly_rate": obj.get("hourly_rate") if obj.get("hourly_rate") is not None else 0.0, + "id": obj.get("id"), + "note": obj.get("note") if obj.get("note") is not None else 'null', + "number": obj.get("number"), + "position_id": obj.get("position_id"), + "project_id": obj.get("project_id"), + "login_id": obj.get("login_id"), + "timer_value": obj.get("timer_value") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/time_trackings.py b/generated/async/easybill_generated_async/models/time_trackings.py new file mode 100644 index 0000000..951ac4e --- /dev/null +++ b/generated/async/easybill_generated_async/models/time_trackings.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.time_tracking import TimeTracking +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TimeTrackings(BaseModel): + """ + TimeTrackings + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[TimeTracking]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TimeTrackings from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TimeTrackings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [TimeTracking.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/web_hook.py b/generated/async/easybill_generated_async/models/web_hook.py new file mode 100644 index 0000000..a4f1463 --- /dev/null +++ b/generated/async/easybill_generated_async/models/web_hook.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.web_hook_last_response import WebHookLastResponse +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebHook(BaseModel): + """ + WebHook + """ # noqa: E501 + content_type: StrictStr + description: StrictStr + events: List[StrictStr] + id: Optional[StrictInt] = None + is_active: Optional[StrictBool] = False + last_response: Optional[WebHookLastResponse] = None + secret: StrictStr + url: StrictStr + __properties: ClassVar[List[str]] = ["content_type", "description", "events", "id", "is_active", "last_response", "secret", "url"] + + @field_validator('content_type') + def content_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['form', 'json']): + raise ValueError("must be one of enum values ('form', 'json')") + return value + + @field_validator('events') + def events_validate_enum(cls, value): + """Validates the enum""" + for i in value: + if i not in set(['document.create', 'document.update', 'document.completed', 'document.deleted', 'document.payment_add', 'document.payment_delete', 'customer.create', 'customer.update', 'customer.delete', 'contact.create', 'contact.update', 'contact.delete', 'position.create', 'position.update', 'position.delete', 'postbox.create', 'postbox.update', 'postbox.delete', 'postbox.sent']): + raise ValueError("each list item must be one of ('document.create', 'document.update', 'document.completed', 'document.deleted', 'document.payment_add', 'document.payment_delete', 'customer.create', 'customer.update', 'customer.delete', 'contact.create', 'contact.update', 'contact.delete', 'position.create', 'position.update', 'position.delete', 'postbox.create', 'postbox.update', 'postbox.delete', 'postbox.sent')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebHook from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of last_response + if self.last_response: + _dict['last_response'] = self.last_response.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebHook from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content_type": obj.get("content_type"), + "description": obj.get("description"), + "events": obj.get("events"), + "id": obj.get("id"), + "is_active": obj.get("is_active") if obj.get("is_active") is not None else False, + "last_response": WebHookLastResponse.from_dict(obj["last_response"]) if obj.get("last_response") is not None else None, + "secret": obj.get("secret"), + "url": obj.get("url") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/web_hook_last_response.py b/generated/async/easybill_generated_async/models/web_hook_last_response.py new file mode 100644 index 0000000..432034b --- /dev/null +++ b/generated/async/easybill_generated_async/models/web_hook_last_response.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebHookLastResponse(BaseModel): + """ + WebHookLastResponse + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, alias="date") + code: Optional[StrictInt] = None + response: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["date", "code", "response"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebHookLastResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "var_date", + "code", + "response", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebHookLastResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "code": obj.get("code"), + "response": obj.get("response") + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/models/web_hooks.py b/generated/async/easybill_generated_async/models/web_hooks.py new file mode 100644 index 0000000..e5dcdb9 --- /dev/null +++ b/generated/async/easybill_generated_async/models/web_hooks.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_async.models.web_hook import WebHook +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebHooks(BaseModel): + """ + WebHooks + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[WebHook]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebHooks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebHooks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [WebHook.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/async/easybill_generated_async/py.typed b/generated/async/easybill_generated_async/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/generated/async/easybill_generated_async/rest.py b/generated/async/easybill_generated_async/rest.py new file mode 100644 index 0000000..929b805 --- /dev/null +++ b/generated/async/easybill_generated_async/rest.py @@ -0,0 +1,226 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import json +import re +import ssl +from typing import Optional, Union + +import aiohttp +import aiohttp_retry + +from easybill_generated_async.exceptions import ApiException, ApiValueError + +RESTResponseType = aiohttp.ClientResponse + +ALLOW_RETRY_METHODS = frozenset({'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'TRACE'}) + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + async def read(self): + if self.data is None: + self.data = await self.response.read() + return self.data + + @property + def headers(self): + """Returns a CIMultiDictProxy of response headers.""" + return self.response.headers + + def getheaders(self): + """Returns a CIMultiDictProxy of the response headers; use ``headers`` instead.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header; use ``headers.get()`` instead.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + + # maxsize is number of requests to host that are allowed in parallel + self.maxsize = configuration.connection_pool_maxsize + + self.ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert, + cadata=configuration.ca_cert_data, + ) + if configuration.cert_file: + self.ssl_context.load_cert_chain( + configuration.cert_file, keyfile=configuration.key_file + ) + + if not configuration.verify_ssl: + self.ssl_context.check_hostname = False + self.ssl_context.verify_mode = ssl.CERT_NONE + + self.proxy = configuration.proxy + self.proxy_headers = configuration.proxy_headers + + retries = configuration.retries + if retries is None: + self._effective_retry_options = None + elif isinstance(retries, aiohttp_retry.RetryOptionsBase): + self._effective_retry_options = retries + elif isinstance(retries, int): + self._effective_retry_options = aiohttp_retry.ExponentialRetry( + attempts=retries, + factor=2.0, + start_timeout=0.1, + max_timeout=120.0 + ) + else: + self._effective_retry_options = None + + self.pool_manager: Optional[aiohttp.ClientSession] = None + self.retry_client: Optional[aiohttp_retry.RetryClient] = None + + async def close(self) -> None: + if self.pool_manager: + await self.pool_manager.close() + if self.retry_client is not None: + await self.retry_client.close() + + async def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): + """Execute request + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + # url already contains the URL query string + timeout = _request_timeout or 5 * 60 + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + args = { + "method": method, + "url": url, + "timeout": timeout, + "headers": headers + } + + if self.proxy: + args["proxy"] = self.proxy + if self.proxy_headers: + args["proxy_headers"] = self.proxy_headers + + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if re.search('json', headers['Content-Type'], re.IGNORECASE): + if body is not None: + body = json.dumps(body) + args["data"] = body + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': + args["data"] = aiohttp.FormData(post_params) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by aiohttp + del headers['Content-Type'] + data = aiohttp.FormData() + for param in post_params: + k, v = param + if isinstance(v, tuple) and len(v) == 3: + data.add_field( + k, + value=v[1], + filename=v[0], + content_type=v[2] + ) + else: + # Ensures that dict objects are serialized + if isinstance(v, dict): + v = json.dumps(v) + elif isinstance(v, int): + v = str(v) + data.add_field(k, v) + args["data"] = data + + # Pass a `bytes` or `str` parameter directly in the body to support + # other content types than Json when `body` argument is provided + # in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + args["data"] = body + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + + pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient] + + # https pool manager + if self.pool_manager is None: + self.pool_manager = aiohttp.ClientSession( + connector=aiohttp.TCPConnector(limit=self.maxsize, ssl=self.ssl_context), + trust_env=True, + ) + pool_manager = self.pool_manager + + if self._effective_retry_options is not None and method in ALLOW_RETRY_METHODS: + if self.retry_client is None: + self.retry_client = aiohttp_retry.RetryClient( + client_session=self.pool_manager, + retry_options=self._effective_retry_options + ) + pool_manager = self.retry_client + + r = await pool_manager.request(**args) + + return RESTResponse(r) diff --git a/generated/async/git_push.sh b/generated/async/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/generated/async/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/generated/async/pyproject.toml b/generated/async/pyproject.toml new file mode 100644 index 0000000..2f30827 --- /dev/null +++ b/generated/async/pyproject.toml @@ -0,0 +1,95 @@ +[project] +name = "easybill_generated_async" +version = "1.0.0" +description = "easybill REST API" +authors = [ + {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, +] +readme = "README.md" +keywords = ["OpenAPI", "OpenAPI-Generator", "easybill REST API"] +requires-python = ">=3.9" + +dependencies = [ + "python-dateutil (>=2.8.2)", + "aiohttp (>=3.8.4)", + "aiohttp-retry (>=2.8.3)", + "pydantic (>=2.11)", + "typing-extensions (>=4.7.1)", +] + +[project.urls] +Repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" + +[tool.poetry] +requires-poetry = ">=2.0" + +[tool.poetry.group.dev.dependencies] +pytest = ">= 7.2.1" +pytest-cov = ">= 2.8.1" +tox = ">= 3.9.0" +flake8 = ">= 4.0.0" +types-python-dateutil = ">= 2.8.19.14" +mypy = ">= 1.5" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "easybill_generated_async", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +extra_checks = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true + +[[tool.mypy.overrides]] +module = [ + "easybill_generated_async.configuration", +] +warn_unused_ignores = true +strict_equality = true +extra_checks = true +check_untyped_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true +disallow_untyped_calls = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +no_implicit_reexport = true +warn_return_any = true diff --git a/generated/async/requirements.txt b/generated/async/requirements.txt new file mode 100644 index 0000000..10da70b --- /dev/null +++ b/generated/async/requirements.txt @@ -0,0 +1,5 @@ +python_dateutil >= 2.8.2 +aiohttp >= 3.8.4 +aiohttp-retry >= 2.8.3 +pydantic >= 2.11 +typing-extensions >= 4.7.1 diff --git a/generated/async/setup.cfg b/generated/async/setup.cfg new file mode 100644 index 0000000..11433ee --- /dev/null +++ b/generated/async/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/generated/async/setup.py b/generated/async/setup.py new file mode 100644 index 0000000..7f14cb3 --- /dev/null +++ b/generated/async/setup.py @@ -0,0 +1,48 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "easybill-generated-async" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">= 3.10" +REQUIRES = [ + "python-dateutil >= 2.8.2", + "aiohttp >= 3.8.4", + "aiohttp-retry >= 2.8.3", + "pydantic >= 2.11", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="easybill REST API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "easybill REST API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode('<email>:<api_key>') # Bearer Token Authorization: Bearer <api_key> ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + """, # noqa: E501 + package_data={"easybill_generated_async": ["py.typed"]}, +) diff --git a/generated/async/test-requirements.txt b/generated/async/test-requirements.txt new file mode 100644 index 0000000..e98555c --- /dev/null +++ b/generated/async/test-requirements.txt @@ -0,0 +1,6 @@ +pytest >= 7.2.1 +pytest-cov >= 2.8.1 +tox >= 3.9.0 +flake8 >= 4.0.0 +types-python-dateutil >= 2.8.19.14 +mypy >= 1.5 diff --git a/generated/async/test/__init__.py b/generated/async/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/generated/async/test/test_advanced_data_field.py b/generated/async/test/test_advanced_data_field.py new file mode 100644 index 0000000..4e1af13 --- /dev/null +++ b/generated/async/test/test_advanced_data_field.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.advanced_data_field import AdvancedDataField + +class TestAdvancedDataField(unittest.TestCase): + """AdvancedDataField unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AdvancedDataField: + """Test AdvancedDataField + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AdvancedDataField` + """ + model = AdvancedDataField() + if include_optional: + return AdvancedDataField( + identifier = 'BT-10', + value = 'Customer-Ref-123' + ) + else: + return AdvancedDataField( + identifier = 'BT-10', + value = 'Customer-Ref-123', + ) + """ + + def testAdvancedDataField(self): + """Test AdvancedDataField""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_attachment.py b/generated/async/test/test_attachment.py new file mode 100644 index 0000000..f459dec --- /dev/null +++ b/generated/async/test/test_attachment.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.attachment import Attachment + +class TestAttachment(unittest.TestCase): + """Attachment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Attachment: + """Test Attachment + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Attachment` + """ + model = Attachment() + if include_optional: + return Attachment( + created_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + customer_id = 56, + document_id = 56, + file_name = 'my_doc.pdf', + id = 56, + project_id = 56, + size = 10022 + ) + else: + return Attachment( + ) + """ + + def testAttachment(self): + """Test Attachment""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_attachment_api.py b/generated/async/test/test_attachment_api.py new file mode 100644 index 0000000..72af228 --- /dev/null +++ b/generated/async/test/test_attachment_api.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.attachment_api import AttachmentApi + + +class TestAttachmentApi(unittest.IsolatedAsyncioTestCase): + """AttachmentApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = AttachmentApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_attachments_get(self) -> None: + """Test case for attachments_get + + Fetch attachments list + """ + pass + + async def test_attachments_id_content_get(self) -> None: + """Test case for attachments_id_content_get + + Fetch attachment content + """ + pass + + async def test_attachments_id_delete(self) -> None: + """Test case for attachments_id_delete + + Delete attachment + """ + pass + + async def test_attachments_id_get(self) -> None: + """Test case for attachments_id_get + + Fetch attachment + """ + pass + + async def test_attachments_id_put(self) -> None: + """Test case for attachments_id_put + + Update attachment + """ + pass + + async def test_attachments_post(self) -> None: + """Test case for attachments_post + + Create attachment + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_attachments.py b/generated/async/test/test_attachments.py new file mode 100644 index 0000000..524b05b --- /dev/null +++ b/generated/async/test/test_attachments.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.attachments import Attachments + +class TestAttachments(unittest.TestCase): + """Attachments unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Attachments: + """Test Attachments + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Attachments` + """ + model = Attachments() + if include_optional: + return Attachments( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.attachment.Attachment( + created_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + customer_id = 56, + document_id = 56, + file_name = 'my_doc.pdf', + id = 56, + project_id = 56, + size = 10022, ) + ] + ) + else: + return Attachments( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testAttachments(self): + """Test Attachments""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_contact.py b/generated/async/test/test_contact.py new file mode 100644 index 0000000..0d25b7b --- /dev/null +++ b/generated/async/test/test_contact.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.contact import Contact + +class TestContact(unittest.TestCase): + """Contact unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Contact: + """Test Contact + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Contact` + """ + model = Contact() + if include_optional: + return Contact( + city = 'Musterstadt', + state = 'NRW', + company_name = 'Musterfirma GmbH', + country = 'DE', + department = 'null', + emails = [ + 'mustermann@easybill.de' + ], + fax = 'null', + first_name = 'null', + id = 56, + last_name = 'null', + login_id = 56, + mobile = 'null', + note = 'null', + personal = True, + phone_1 = 'null', + phone_2 = 'null', + salutation = 56, + street = 'Musterstr.', + suffix_1 = 'null', + suffix_2 = 'null', + title = 'null', + zip_code = 'null', + created_at = '2018-01-01 23:23:45', + updated_at = '2018-01-01 23:23:45' + ) + else: + return Contact( + city = 'Musterstadt', + street = 'Musterstr.', + ) + """ + + def testContact(self): + """Test Contact""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_contact_api.py b/generated/async/test/test_contact_api.py new file mode 100644 index 0000000..1382fd9 --- /dev/null +++ b/generated/async/test/test_contact_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.contact_api import ContactApi + + +class TestContactApi(unittest.IsolatedAsyncioTestCase): + """ContactApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = ContactApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_customers_customer_id_contacts_get(self) -> None: + """Test case for customers_customer_id_contacts_get + + Fetch customer contact list + """ + pass + + async def test_customers_customer_id_contacts_id_delete(self) -> None: + """Test case for customers_customer_id_contacts_id_delete + + Delete contact + """ + pass + + async def test_customers_customer_id_contacts_id_get(self) -> None: + """Test case for customers_customer_id_contacts_id_get + + Fetch contact + """ + pass + + async def test_customers_customer_id_contacts_id_put(self) -> None: + """Test case for customers_customer_id_contacts_id_put + + Update Contact + """ + pass + + async def test_customers_customer_id_contacts_post(self) -> None: + """Test case for customers_customer_id_contacts_post + + Create new contact + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_contacts.py b/generated/async/test/test_contacts.py new file mode 100644 index 0000000..1b23367 --- /dev/null +++ b/generated/async/test/test_contacts.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.contacts import Contacts + +class TestContacts(unittest.TestCase): + """Contacts unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Contacts: + """Test Contacts + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Contacts` + """ + model = Contacts() + if include_optional: + return Contacts( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.contact.Contact( + city = 'Musterstadt', + state = 'NRW', + company_name = 'Musterfirma GmbH', + country = 'DE', + department = 'null', + emails = [ + 'mustermann@easybill.de' + ], + fax = 'null', + first_name = 'null', + id = 56, + last_name = 'null', + login_id = 56, + mobile = 'null', + note = 'null', + personal = True, + phone_1 = 'null', + phone_2 = 'null', + salutation = 56, + street = 'Musterstr.', + suffix_1 = 'null', + suffix_2 = 'null', + title = 'null', + zip_code = 'null', + created_at = '2018-01-01 23:23:45', + updated_at = '2018-01-01 23:23:45', ) + ] + ) + else: + return Contacts( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testContacts(self): + """Test Contacts""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_customer.py b/generated/async/test/test_customer.py new file mode 100644 index 0000000..4b46a4d --- /dev/null +++ b/generated/async/test/test_customer.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.customer import Customer + +class TestCustomer(unittest.TestCase): + """Customer unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Customer: + """Test Customer + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Customer` + """ + model = Customer() + if include_optional: + return Customer( + acquire_options = 5, + additional_groups_ids = [], + bank_account = '123456789', + bank_account_owner = 'Max Mustermann', + bank_bic = 'DEUTDEFF', + bank_code = '50070024', + bank_iban = 'DE89370400440532013000', + bank_name = 'Musterbank', + birth_date = 'Sat Dec 31 00:00:00 UTC 2016', + cash_allowance = 2.0, + cash_allowance_days = 7, + cash_discount = 3.0, + cash_discount_type = 'PERCENT', + city = 'Kaarst', + state = 'NRW', + company_name = 'easybill GmbH', + country = 'DE', + created_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + updated_at = '', + delivery_title = 'Dr.', + delivery_city = 'Hamburg', + delivery_state = 'NRW', + delivery_company_name = 'Musterfirma Logistik GmbH', + delivery_country = 'DE', + delivery_first_name = 'Erika', + delivery_last_name = 'Musterfrau', + delivery_personal = False, + delivery_salutation = 56, + delivery_street = 'Lieferstraße 42', + delivery_suffix_1 = 'Hinterhaus', + delivery_suffix_2 = '3. Etage', + delivery_zip_code = '20095', + display_name = '', + emails = [max.mustermann@easybill.de], + fax = '+49 2154 89701 29', + first_name = 'Max', + grace_period = 14, + due_in_days = 14, + group_id = 1, + id = 56, + info_1 = 'Kundennummer: 12345', + info_2 = 'Abteilung: Einkauf', + internet = 'https://www.easybill.de', + last_name = 'Mustermann', + login_id = 56, + mobile = '+49 170 1234567', + note = 'Wichtiger Kunde, bevorzugte Betreuung', + number = '', + supplier_number = '', + payment_options = 1, + personal = False, + phone_1 = '+49 2154 89701 20', + phone_2 = '+49 2154 89701 21', + postbox = 'Postfach 1234', + postbox_city = 'Düsseldorf', + postbox_state = 'NRW', + postbox_country = 'DE', + postbox_zip_code = '40213', + sale_price_level = 'SALEPRICE3', + salutation = 56, + sepa_agreement = 'BASIC', + sepa_agreement_date = 'Sat Jan 15 00:00:00 UTC 2022', + sepa_mandate_reference = 'MANDAT-2022-0815', + since_date = 'Sun Mar 01 00:00:00 UTC 2020', + street = 'Düsselstr. 21', + suffix_1 = 'c/o Musterfirma GmbH', + suffix_2 = '2. Stock, links', + tax_number = '21/815/08150', + court = 'Berlin', + court_registry_number = 'HRB XXXXX X', + tax_options = 'IG', + title = 'Dr.', + archived = False, + vat_identifier = 'DE814878557', + zip_code = '41564', + document_pdf_type = 'default', + buyer_reference = '', + foreign_supplier_number = '' + ) + else: + return Customer( + company_name = 'easybill GmbH', + last_name = 'Mustermann', + ) + """ + + def testCustomer(self): + """Test Customer""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_customer_api.py b/generated/async/test/test_customer_api.py new file mode 100644 index 0000000..1b9cf16 --- /dev/null +++ b/generated/async/test/test_customer_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.customer_api import CustomerApi + + +class TestCustomerApi(unittest.IsolatedAsyncioTestCase): + """CustomerApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = CustomerApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_customers_get(self) -> None: + """Test case for customers_get + + Fetch customers list + """ + pass + + async def test_customers_id_delete(self) -> None: + """Test case for customers_id_delete + + Delete customer + """ + pass + + async def test_customers_id_get(self) -> None: + """Test case for customers_id_get + + Fetch customer + """ + pass + + async def test_customers_id_put(self) -> None: + """Test case for customers_id_put + + Update Customer + """ + pass + + async def test_customers_post(self) -> None: + """Test case for customers_post + + Create customer + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_customer_group.py b/generated/async/test/test_customer_group.py new file mode 100644 index 0000000..7917603 --- /dev/null +++ b/generated/async/test/test_customer_group.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.customer_group import CustomerGroup + +class TestCustomerGroup(unittest.TestCase): + """CustomerGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CustomerGroup: + """Test CustomerGroup + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CustomerGroup` + """ + model = CustomerGroup() + if include_optional: + return CustomerGroup( + name = 'Important Customers', + description = 'null', + number = '001', + display_name = '001 - Important Customers', + id = 56 + ) + else: + return CustomerGroup( + name = 'Important Customers', + number = '001', + ) + """ + + def testCustomerGroup(self): + """Test CustomerGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_customer_group_api.py b/generated/async/test/test_customer_group_api.py new file mode 100644 index 0000000..46e14be --- /dev/null +++ b/generated/async/test/test_customer_group_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.customer_group_api import CustomerGroupApi + + +class TestCustomerGroupApi(unittest.IsolatedAsyncioTestCase): + """CustomerGroupApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = CustomerGroupApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_customer_groups_get(self) -> None: + """Test case for customer_groups_get + + Fetch customer group list + """ + pass + + async def test_customer_groups_id_delete(self) -> None: + """Test case for customer_groups_id_delete + + Delete customer group + """ + pass + + async def test_customer_groups_id_get(self) -> None: + """Test case for customer_groups_id_get + + Fetch customer group + """ + pass + + async def test_customer_groups_id_put(self) -> None: + """Test case for customer_groups_id_put + + Update customer group + """ + pass + + async def test_customer_groups_post(self) -> None: + """Test case for customer_groups_post + + Create customer group + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_customer_groups.py b/generated/async/test/test_customer_groups.py new file mode 100644 index 0000000..fb979da --- /dev/null +++ b/generated/async/test/test_customer_groups.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.customer_groups import CustomerGroups + +class TestCustomerGroups(unittest.TestCase): + """CustomerGroups unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CustomerGroups: + """Test CustomerGroups + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CustomerGroups` + """ + model = CustomerGroups() + if include_optional: + return CustomerGroups( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.customer_group.CustomerGroup( + name = 'Important Customers', + description = 'null', + number = '001', + display_name = '001 - Important Customers', + id = 56, ) + ] + ) + else: + return CustomerGroups( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testCustomerGroups(self): + """Test CustomerGroups""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_customer_snapshot.py b/generated/async/test/test_customer_snapshot.py new file mode 100644 index 0000000..ed29085 --- /dev/null +++ b/generated/async/test/test_customer_snapshot.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.customer_snapshot import CustomerSnapshot + +class TestCustomerSnapshot(unittest.TestCase): + """CustomerSnapshot unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CustomerSnapshot: + """Test CustomerSnapshot + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CustomerSnapshot` + """ + model = CustomerSnapshot() + if include_optional: + return CustomerSnapshot( + acquire_options = 5, + additional_groups_ids = [], + bank_account = '123456789', + bank_account_owner = 'Max Mustermann', + bank_bic = 'DEUTDEFF', + bank_code = '50070024', + bank_iban = 'DE89370400440532013000', + bank_name = 'Musterbank', + birth_date = 'Sat Dec 31 00:00:00 UTC 2016', + cash_allowance = 2.0, + cash_allowance_days = 7, + cash_discount = 3.0, + cash_discount_type = 'PERCENT', + city = 'Kaarst', + state = 'NRW', + company_name = 'easybill GmbH', + country = 'DE', + created_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + updated_at = '', + delivery_title = 'Dr.', + delivery_city = 'Hamburg', + delivery_state = 'NRW', + delivery_company_name = 'Musterfirma Logistik GmbH', + delivery_country = 'DE', + delivery_first_name = 'Erika', + delivery_last_name = 'Musterfrau', + delivery_personal = False, + delivery_salutation = 56, + delivery_street = 'Lieferstraße 42', + delivery_suffix_1 = 'Hinterhaus', + delivery_suffix_2 = '3. Etage', + delivery_zip_code = '20095', + display_name = '', + emails = [max.mustermann@easybill.de], + fax = '+49 2154 89701 29', + first_name = 'Max', + grace_period = 14, + due_in_days = 14, + group_id = 1, + id = 56, + info_1 = 'Kundennummer: 12345', + info_2 = 'Abteilung: Einkauf', + internet = 'https://www.easybill.de', + last_name = 'Mustermann', + login_id = 56, + mobile = '+49 170 1234567', + note = 'Wichtiger Kunde, bevorzugte Betreuung', + number = '', + supplier_number = '', + payment_options = 1, + personal = False, + phone_1 = '+49 2154 89701 20', + phone_2 = '+49 2154 89701 21', + postbox = 'Postfach 1234', + postbox_city = 'Düsseldorf', + postbox_state = 'NRW', + postbox_country = 'DE', + postbox_zip_code = '40213', + sale_price_level = 'SALEPRICE3', + salutation = 56, + sepa_agreement = 'BASIC', + sepa_agreement_date = 'Sat Jan 15 00:00:00 UTC 2022', + sepa_mandate_reference = 'MANDAT-2022-0815', + since_date = 'Sun Mar 01 00:00:00 UTC 2020', + street = 'Düsselstr. 21', + suffix_1 = 'c/o Musterfirma GmbH', + suffix_2 = '2. Stock, links', + tax_number = '21/815/08150', + court = 'Berlin', + court_registry_number = 'HRB XXXXX X', + tax_options = 'IG', + title = 'Dr.', + archived = False, + vat_identifier = 'DE814878557', + zip_code = '41564', + document_pdf_type = 'default', + buyer_reference = '', + foreign_supplier_number = '' + ) + else: + return CustomerSnapshot( + company_name = 'easybill GmbH', + last_name = 'Mustermann', + ) + """ + + def testCustomerSnapshot(self): + """Test CustomerSnapshot""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_customers.py b/generated/async/test/test_customers.py new file mode 100644 index 0000000..0cb3f65 --- /dev/null +++ b/generated/async/test/test_customers.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.customers import Customers + +class TestCustomers(unittest.TestCase): + """Customers unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Customers: + """Test Customers + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Customers` + """ + model = Customers() + if include_optional: + return Customers( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.customer.Customer( + acquire_options = 5, + additional_groups_ids = [], + bank_account = '123456789', + bank_account_owner = 'Max Mustermann', + bank_bic = 'DEUTDEFF', + bank_code = '50070024', + bank_iban = 'DE89370400440532013000', + bank_name = 'Musterbank', + birth_date = 'Sat Dec 31 00:00:00 UTC 2016', + cash_allowance = 2.0, + cash_allowance_days = 7, + cash_discount = 3.0, + cash_discount_type = 'PERCENT', + city = 'Kaarst', + state = 'NRW', + company_name = 'easybill GmbH', + country = 'DE', + created_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + updated_at = '', + delivery_title = 'Dr.', + delivery_city = 'Hamburg', + delivery_state = 'NRW', + delivery_company_name = 'Musterfirma Logistik GmbH', + delivery_country = 'DE', + delivery_first_name = 'Erika', + delivery_last_name = 'Musterfrau', + delivery_personal = False, + delivery_salutation = 56, + delivery_street = 'Lieferstraße 42', + delivery_suffix_1 = 'Hinterhaus', + delivery_suffix_2 = '3. Etage', + delivery_zip_code = '20095', + display_name = '', + emails = [max.mustermann@easybill.de], + fax = '+49 2154 89701 29', + first_name = 'Max', + grace_period = 14, + due_in_days = 14, + group_id = 1, + id = 56, + info_1 = 'Kundennummer: 12345', + info_2 = 'Abteilung: Einkauf', + internet = 'https://www.easybill.de', + last_name = 'Mustermann', + login_id = 56, + mobile = '+49 170 1234567', + note = 'Wichtiger Kunde, bevorzugte Betreuung', + number = '', + supplier_number = '', + payment_options = 1, + personal = False, + phone_1 = '+49 2154 89701 20', + phone_2 = '+49 2154 89701 21', + postbox = 'Postfach 1234', + postbox_city = 'Düsseldorf', + postbox_state = 'NRW', + postbox_country = 'DE', + postbox_zip_code = '40213', + sale_price_level = 'SALEPRICE3', + salutation = 56, + sepa_agreement = 'BASIC', + sepa_agreement_date = 'Sat Jan 15 00:00:00 UTC 2022', + sepa_mandate_reference = 'MANDAT-2022-0815', + since_date = 'Sun Mar 01 00:00:00 UTC 2020', + street = 'Düsselstr. 21', + suffix_1 = 'c/o Musterfirma GmbH', + suffix_2 = '2. Stock, links', + tax_number = '21/815/08150', + court = 'Berlin', + court_registry_number = 'HRB XXXXX X', + tax_options = 'IG', + title = 'Dr.', + archived = False, + vat_identifier = 'DE814878557', + zip_code = '41564', + document_pdf_type = 'default', + buyer_reference = '', + foreign_supplier_number = '', ) + ] + ) + else: + return Customers( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testCustomers(self): + """Test Customers""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_discount.py b/generated/async/test/test_discount.py new file mode 100644 index 0000000..4632156 --- /dev/null +++ b/generated/async/test/test_discount.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.discount import Discount + +class TestDiscount(unittest.TestCase): + """Discount unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Discount: + """Test Discount + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Discount` + """ + model = Discount() + if include_optional: + return Discount( + id = 56, + customer_id = 56, + discount = 10, + discount_type = 'PERCENT' + ) + else: + return Discount( + customer_id = 56, + ) + """ + + def testDiscount(self): + """Test Discount""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_discount_api.py b/generated/async/test/test_discount_api.py new file mode 100644 index 0000000..b196667 --- /dev/null +++ b/generated/async/test/test_discount_api.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.discount_api import DiscountApi + + +class TestDiscountApi(unittest.IsolatedAsyncioTestCase): + """DiscountApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = DiscountApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_discounts_position_get(self) -> None: + """Test case for discounts_position_get + + Fetch list of position discounts + """ + pass + + async def test_discounts_position_group_get(self) -> None: + """Test case for discounts_position_group_get + + Fetch list of position-group discounts + """ + pass + + async def test_discounts_position_group_id_delete(self) -> None: + """Test case for discounts_position_group_id_delete + + Delete the specified position-group discount + """ + pass + + async def test_discounts_position_group_id_get(self) -> None: + """Test case for discounts_position_group_id_get + + Fetch specified position-group discount by id + """ + pass + + async def test_discounts_position_group_id_put(self) -> None: + """Test case for discounts_position_group_id_put + + Update a position-group discount + """ + pass + + async def test_discounts_position_group_post(self) -> None: + """Test case for discounts_position_group_post + + Create a new position-group discount + """ + pass + + async def test_discounts_position_id_delete(self) -> None: + """Test case for discounts_position_id_delete + + Delete the specified position discount + """ + pass + + async def test_discounts_position_id_get(self) -> None: + """Test case for discounts_position_id_get + + Fetch specified position discount by id + """ + pass + + async def test_discounts_position_id_put(self) -> None: + """Test case for discounts_position_id_put + + Update a position discount + """ + pass + + async def test_discounts_position_post(self) -> None: + """Test case for discounts_position_post + + Create a new position discount + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_discount_position.py b/generated/async/test/test_discount_position.py new file mode 100644 index 0000000..e85ddfb --- /dev/null +++ b/generated/async/test/test_discount_position.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.discount_position import DiscountPosition + +class TestDiscountPosition(unittest.TestCase): + """DiscountPosition unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscountPosition: + """Test DiscountPosition + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscountPosition` + """ + model = DiscountPosition() + if include_optional: + return DiscountPosition( + id = 56, + customer_id = 56, + discount = 10, + discount_type = 'PERCENT', + position_id = 56 + ) + else: + return DiscountPosition( + customer_id = 56, + position_id = 56, + ) + """ + + def testDiscountPosition(self): + """Test DiscountPosition""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_discount_position_group.py b/generated/async/test/test_discount_position_group.py new file mode 100644 index 0000000..dc73827 --- /dev/null +++ b/generated/async/test/test_discount_position_group.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.discount_position_group import DiscountPositionGroup + +class TestDiscountPositionGroup(unittest.TestCase): + """DiscountPositionGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscountPositionGroup: + """Test DiscountPositionGroup + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscountPositionGroup` + """ + model = DiscountPositionGroup() + if include_optional: + return DiscountPositionGroup( + id = 56, + customer_id = 56, + discount = 10, + discount_type = 'PERCENT', + position_group_id = 56 + ) + else: + return DiscountPositionGroup( + customer_id = 56, + position_group_id = 56, + ) + """ + + def testDiscountPositionGroup(self): + """Test DiscountPositionGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_discount_position_groups.py b/generated/async/test/test_discount_position_groups.py new file mode 100644 index 0000000..22581cf --- /dev/null +++ b/generated/async/test/test_discount_position_groups.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.discount_position_groups import DiscountPositionGroups + +class TestDiscountPositionGroups(unittest.TestCase): + """DiscountPositionGroups unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscountPositionGroups: + """Test DiscountPositionGroups + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscountPositionGroups` + """ + model = DiscountPositionGroups() + if include_optional: + return DiscountPositionGroups( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + null + ] + ) + else: + return DiscountPositionGroups( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testDiscountPositionGroups(self): + """Test DiscountPositionGroups""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_discount_positions.py b/generated/async/test/test_discount_positions.py new file mode 100644 index 0000000..688c7e2 --- /dev/null +++ b/generated/async/test/test_discount_positions.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.discount_positions import DiscountPositions + +class TestDiscountPositions(unittest.TestCase): + """DiscountPositions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscountPositions: + """Test DiscountPositions + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscountPositions` + """ + model = DiscountPositions() + if include_optional: + return DiscountPositions( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + null + ] + ) + else: + return DiscountPositions( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testDiscountPositions(self): + """Test DiscountPositions""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_document.py b/generated/async/test/test_document.py new file mode 100644 index 0000000..dfef72d --- /dev/null +++ b/generated/async/test/test_document.py @@ -0,0 +1,212 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.document import Document + +class TestDocument(unittest.TestCase): + """Document unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Document: + """Test Document + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Document` + """ + model = Document() + if include_optional: + return Document( + address = easybill_generated_async.models.document_address.DocumentAddress( + salutation = 56, + personal = False, + title = 'Dr.', + first_name = 'Max', + last_name = 'Mustermann', + suffix_1 = 'Abteilung Vertrieb', + suffix_2 = '3. Etage', + company_name = 'Musterunternehmen AG', + street = 'Musterstr.', + zip_code = '12345', + city = 'Musterstadt', + state = 'NRW', + country = 'DE', ), + advanced_data_fields = [], + attachment_ids = [], + label_address = easybill_generated_async.models.document_address.DocumentAddress( + salutation = 56, + personal = False, + title = 'Dr.', + first_name = 'Max', + last_name = 'Mustermann', + suffix_1 = 'Abteilung Vertrieb', + suffix_2 = '3. Etage', + company_name = 'Musterunternehmen AG', + street = 'Musterstr.', + zip_code = '12345', + city = 'Musterstadt', + state = 'NRW', + country = 'DE', ), + amount = 56, + amount_net = 56, + anonymize_due_date = 'Thu Feb 07 00:00:00 UTC 2019', + anonymize_status = 'NOT_ANONYMIZED', + anonymized_at = '2019-02-07 00:00:00', + bank_debit_form = 'null', + billing_country = 'null', + calc_vat_from = 0, + cancel_id = 56, + cash_allowance = 1.337, + cash_allowance_days = 56, + cash_allowance_text = 'null', + contact_id = 56, + contact_label = '', + contact_text = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + currency = 'EUR', + customer_id = 56, + customer_snapshot = None, + discount = 'null', + discount_type = 'PERCENT', + document_date = 'Thu Feb 07 00:00:00 UTC 2019', + due_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + edited_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + external_id = 'null', + replica_url = 'null', + grace_period = 56, + due_in_days = 56, + id = 56, + is_acceptable_on_public_domain = False, + is_archive = False, + is_draft = True, + is_replica = False, + is_oss = False, + item_notes = [ + '' + ], + items = [ + easybill_generated_async.models.document_position.DocumentPosition( + number = 'null', + description = 'null', + document_note = 'Test Note', + quantity = 1.0, + quantity_str = '1:30 h', + unit = 'null', + type = 'POSITION', + position = 1, + single_price_net = 75.0, + single_price_gross = 1.337, + vat_percent = 0.0, + discount = 10.0, + discount_type = 'PERCENT', + position_id = 123456, + total_price_net = 1.337, + total_price_gross = 1.337, + total_vat = 1.337, + serial_number_id = 'SN-2023-001-ID', + serial_number = 'SN-2023-001', + booking_account = 'null', + export_cost_1 = 'null', + export_cost_2 = 'null', + cost_price_net = 45.5, + cost_price_total = 45.5, + cost_price_charge = 10.0, + cost_price_charge_type = 'PERCENT', + item_type = 'UNDEFINED', + id = 56, ) + ], + last_postbox_id = 56, + login_id = 56, + number = 'null', + order_number = '', + buyer_reference = '', + paid_amount = 56, + paid_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + pdf_pages = 56, + pdf_template = 'null', + payment_link_enabled = False, + payment_link_locale = 'de', + project_id = 56, + recurring_options = easybill_generated_async.models.document_recurring.DocumentRecurring( + next_date = 'Sat Feb 01 00:00:00 UTC 2020', + frequency = 'MONTHLY', + frequency_special = 'LASTDAYOFMONTH', + interval = 1, + end_date_or_count = 'null', + status = 'WAITING', + as_draft = True, + is_notify = True, + send_as = 'EMAIL', + is_sign = True, + is_paid = True, + paid_date_option = 'created_date', + is_sepa = True, + sepa_local_instrument = 'CORE', + sepa_sequence_type = 'FRST', + sepa_reference = 'null', + sepa_remittance_information = 'null', + target_type = 'INVOICE', ), + ref_id = 56, + root_id = 56, + service_date = easybill_generated_async.models.service_date.ServiceDate( + type = 'DEFAULT', + date = 'Fri Feb 01 00:00:00 UTC 2019', + date_from = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + date_to = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + text = 'null', ), + shipping_country = 'null', + status = 'ACCEPT', + text = 'Vielen Dank für Ihren Auftrag! + +Bitte begleichen Sie den offenen Betrag bis zum %DOKUMENT.DATUM-FAELLIG%. + +Mit freundlichen Grüßen + +%FIRMA.FIRMA% +', + text_prefix = '%KUNDE.ANREDE%, +nachfolgend berechnen wir Ihnen wie vorab besprochen: +', + text_tax = 'null', + title = 'null', + type = 'INVOICE', + use_shipping_address = False, + vat_country = 'null', + vat_id = '', + fulfillment_country = 'null', + vat_option = 'NULL', + file_format_config = [ + easybill_generated_async.models.file_format_config.FileFormatConfig( + type = 'default', ) + ] + ) + else: + return Document( + ) + """ + + def testDocument(self): + """Test Document""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_document_address.py b/generated/async/test/test_document_address.py new file mode 100644 index 0000000..f0c2a7c --- /dev/null +++ b/generated/async/test/test_document_address.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.document_address import DocumentAddress + +class TestDocumentAddress(unittest.TestCase): + """DocumentAddress unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentAddress: + """Test DocumentAddress + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentAddress` + """ + model = DocumentAddress() + if include_optional: + return DocumentAddress( + salutation = 56, + personal = False, + title = 'Dr.', + first_name = 'Max', + last_name = 'Mustermann', + suffix_1 = 'Abteilung Vertrieb', + suffix_2 = '3. Etage', + company_name = 'Musterunternehmen AG', + street = 'Musterstr.', + zip_code = '12345', + city = 'Musterstadt', + state = 'NRW', + country = 'DE' + ) + else: + return DocumentAddress( + ) + """ + + def testDocumentAddress(self): + """Test DocumentAddress""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_document_api.py b/generated/async/test/test_document_api.py new file mode 100644 index 0000000..fdd6a5a --- /dev/null +++ b/generated/async/test/test_document_api.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.document_api import DocumentApi + + +class TestDocumentApi(unittest.IsolatedAsyncioTestCase): + """DocumentApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = DocumentApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_documents_get(self) -> None: + """Test case for documents_get + + Fetch documents list + """ + pass + + async def test_documents_id_cancel_post(self) -> None: + """Test case for documents_id_cancel_post + + Cancel document + """ + pass + + async def test_documents_id_delete(self) -> None: + """Test case for documents_id_delete + + Delete document + """ + pass + + async def test_documents_id_done_put(self) -> None: + """Test case for documents_id_done_put + + To complete a document. + """ + pass + + async def test_documents_id_download_get(self) -> None: + """Test case for documents_id_download_get + + Fetch the document in best fitting format to the given Accept header + """ + pass + + async def test_documents_id_get(self) -> None: + """Test case for documents_id_get + + Fetch document + """ + pass + + async def test_documents_id_jpg_get(self) -> None: + """Test case for documents_id_jpg_get + + Download a document as an jpeg-image + """ + pass + + async def test_documents_id_pdf_get(self) -> None: + """Test case for documents_id_pdf_get + + Fetch pdf document + """ + pass + + async def test_documents_id_put(self) -> None: + """Test case for documents_id_put + + Update document + """ + pass + + async def test_documents_id_send_type_post(self) -> None: + """Test case for documents_id_send_type_post + + Send document + """ + pass + + async def test_documents_id_type_post(self) -> None: + """Test case for documents_id_type_post + + Convert an existing document to one of a different type + """ + pass + + async def test_documents_post(self) -> None: + """Test case for documents_post + + Create document + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_document_payment.py b/generated/async/test/test_document_payment.py new file mode 100644 index 0000000..743b3de --- /dev/null +++ b/generated/async/test/test_document_payment.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.document_payment import DocumentPayment + +class TestDocumentPayment(unittest.TestCase): + """DocumentPayment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentPayment: + """Test DocumentPayment + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentPayment` + """ + model = DocumentPayment() + if include_optional: + return DocumentPayment( + amount = 56, + document_id = 56, + id = 56, + is_overdue_fee = True, + login_id = 56, + notice = '', + payment_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + type = '', + provider = '', + reference = '' + ) + else: + return DocumentPayment( + amount = 56, + document_id = 56, + ) + """ + + def testDocumentPayment(self): + """Test DocumentPayment""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_document_payment_api.py b/generated/async/test/test_document_payment_api.py new file mode 100644 index 0000000..a7e7b90 --- /dev/null +++ b/generated/async/test/test_document_payment_api.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.document_payment_api import DocumentPaymentApi + + +class TestDocumentPaymentApi(unittest.IsolatedAsyncioTestCase): + """DocumentPaymentApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = DocumentPaymentApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_document_payments_get(self) -> None: + """Test case for document_payments_get + + Fetch document payments list + """ + pass + + async def test_document_payments_id_delete(self) -> None: + """Test case for document_payments_id_delete + + Delete document payment + """ + pass + + async def test_document_payments_id_get(self) -> None: + """Test case for document_payments_id_get + + Fetch document payment + """ + pass + + async def test_document_payments_post(self) -> None: + """Test case for document_payments_post + + Create document payment + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_document_payments.py b/generated/async/test/test_document_payments.py new file mode 100644 index 0000000..a72cff6 --- /dev/null +++ b/generated/async/test/test_document_payments.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.document_payments import DocumentPayments + +class TestDocumentPayments(unittest.TestCase): + """DocumentPayments unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentPayments: + """Test DocumentPayments + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentPayments` + """ + model = DocumentPayments() + if include_optional: + return DocumentPayments( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + {id=1, document_id=1, login_id=1, amount=1000, payment_at=2007-09-17T00:00:00.000Z, type=VISA, provider=Stripe, reference=111111-VISA-222222-6666} + ] + ) + else: + return DocumentPayments( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testDocumentPayments(self): + """Test DocumentPayments""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_document_position.py b/generated/async/test/test_document_position.py new file mode 100644 index 0000000..5dd37e8 --- /dev/null +++ b/generated/async/test/test_document_position.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.document_position import DocumentPosition + +class TestDocumentPosition(unittest.TestCase): + """DocumentPosition unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentPosition: + """Test DocumentPosition + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentPosition` + """ + model = DocumentPosition() + if include_optional: + return DocumentPosition( + number = 'null', + description = 'null', + document_note = 'Test Note', + quantity = 1.0, + quantity_str = '1:30 h', + unit = 'null', + type = 'POSITION', + position = 1, + single_price_net = 75.0, + single_price_gross = 1.337, + vat_percent = 0.0, + discount = 10.0, + discount_type = 'PERCENT', + position_id = 123456, + total_price_net = 1.337, + total_price_gross = 1.337, + total_vat = 1.337, + serial_number_id = 'SN-2023-001-ID', + serial_number = 'SN-2023-001', + booking_account = 'null', + export_cost_1 = 'null', + export_cost_2 = 'null', + cost_price_net = 45.5, + cost_price_total = 45.5, + cost_price_charge = 10.0, + cost_price_charge_type = 'PERCENT', + item_type = 'UNDEFINED', + id = 56 + ) + else: + return DocumentPosition( + ) + """ + + def testDocumentPosition(self): + """Test DocumentPosition""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_document_recurring.py b/generated/async/test/test_document_recurring.py new file mode 100644 index 0000000..d350675 --- /dev/null +++ b/generated/async/test/test_document_recurring.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.document_recurring import DocumentRecurring + +class TestDocumentRecurring(unittest.TestCase): + """DocumentRecurring unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentRecurring: + """Test DocumentRecurring + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentRecurring` + """ + model = DocumentRecurring() + if include_optional: + return DocumentRecurring( + next_date = 'Sat Feb 01 00:00:00 UTC 2020', + frequency = 'MONTHLY', + frequency_special = 'LASTDAYOFMONTH', + interval = 1, + end_date_or_count = 'null', + status = 'WAITING', + as_draft = True, + is_notify = True, + send_as = 'EMAIL', + is_sign = True, + is_paid = True, + paid_date_option = 'created_date', + is_sepa = True, + sepa_local_instrument = 'CORE', + sepa_sequence_type = 'FRST', + sepa_reference = 'null', + sepa_remittance_information = 'null', + target_type = 'INVOICE' + ) + else: + return DocumentRecurring( + next_date = 'Sat Feb 01 00:00:00 UTC 2020', + ) + """ + + def testDocumentRecurring(self): + """Test DocumentRecurring""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_document_version.py b/generated/async/test/test_document_version.py new file mode 100644 index 0000000..6fafa40 --- /dev/null +++ b/generated/async/test/test_document_version.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.document_version import DocumentVersion + +class TestDocumentVersion(unittest.TestCase): + """DocumentVersion unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentVersion: + """Test DocumentVersion + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentVersion` + """ + model = DocumentVersion() + if include_optional: + return DocumentVersion( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + document_id = 56, + id = 56, + items = [ + easybill_generated_async.models.document_version_item.DocumentVersionItem( + document_version_item_type = 'default', + id = 56, ) + ], + reason = 'Added another position to the document' + ) + else: + return DocumentVersion( + ) + """ + + def testDocumentVersion(self): + """Test DocumentVersion""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_document_version_api.py b/generated/async/test/test_document_version_api.py new file mode 100644 index 0000000..ca125ec --- /dev/null +++ b/generated/async/test/test_document_version_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.document_version_api import DocumentVersionApi + + +class TestDocumentVersionApi(unittest.IsolatedAsyncioTestCase): + """DocumentVersionApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = DocumentVersionApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_documents_id_versions_get(self) -> None: + """Test case for documents_id_versions_get + + List all versions of a given document + """ + pass + + async def test_documents_id_versions_version_id_get(self) -> None: + """Test case for documents_id_versions_version_id_get + + Show a single version of a given document + """ + pass + + async def test_documents_id_versions_version_id_items_version_item_id_download_get(self) -> None: + """Test case for documents_id_versions_version_id_items_version_item_id_download_get + + Download a specific file for a single version of a given document + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_document_version_item.py b/generated/async/test/test_document_version_item.py new file mode 100644 index 0000000..601d1ed --- /dev/null +++ b/generated/async/test/test_document_version_item.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.document_version_item import DocumentVersionItem + +class TestDocumentVersionItem(unittest.TestCase): + """DocumentVersionItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentVersionItem: + """Test DocumentVersionItem + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentVersionItem` + """ + model = DocumentVersionItem() + if include_optional: + return DocumentVersionItem( + document_version_item_type = 'default', + id = 56 + ) + else: + return DocumentVersionItem( + ) + """ + + def testDocumentVersionItem(self): + """Test DocumentVersionItem""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_document_versions.py b/generated/async/test/test_document_versions.py new file mode 100644 index 0000000..45c4678 --- /dev/null +++ b/generated/async/test/test_document_versions.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.document_versions import DocumentVersions + +class TestDocumentVersions(unittest.TestCase): + """DocumentVersions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentVersions: + """Test DocumentVersions + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentVersions` + """ + model = DocumentVersions() + if include_optional: + return DocumentVersions( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.document_version.DocumentVersion( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + document_id = 56, + id = 56, + items = [ + easybill_generated_async.models.document_version_item.DocumentVersionItem( + document_version_item_type = 'default', + id = 56, ) + ], + reason = 'Added another position to the document', ) + ] + ) + else: + return DocumentVersions( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testDocumentVersions(self): + """Test DocumentVersions""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_documents.py b/generated/async/test/test_documents.py new file mode 100644 index 0000000..4447566 --- /dev/null +++ b/generated/async/test/test_documents.py @@ -0,0 +1,223 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.documents import Documents + +class TestDocuments(unittest.TestCase): + """Documents unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Documents: + """Test Documents + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Documents` + """ + model = Documents() + if include_optional: + return Documents( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.document.Document( + address = easybill_generated_async.models.document_address.DocumentAddress( + salutation = 56, + personal = False, + title = 'Dr.', + first_name = 'Max', + last_name = 'Mustermann', + suffix_1 = 'Abteilung Vertrieb', + suffix_2 = '3. Etage', + company_name = 'Musterunternehmen AG', + street = 'Musterstr.', + zip_code = '12345', + city = 'Musterstadt', + state = 'NRW', + country = 'DE', ), + advanced_data_fields = [], + attachment_ids = [], + label_address = easybill_generated_async.models.document_address.DocumentAddress( + salutation = 56, + personal = False, + title = 'Dr.', + first_name = 'Max', + last_name = 'Mustermann', + suffix_1 = 'Abteilung Vertrieb', + suffix_2 = '3. Etage', + company_name = 'Musterunternehmen AG', + street = 'Musterstr.', + zip_code = '12345', + city = 'Musterstadt', + state = 'NRW', + country = 'DE', ), + amount = 56, + amount_net = 56, + anonymize_due_date = 'Thu Feb 07 00:00:00 UTC 2019', + anonymize_status = 'NOT_ANONYMIZED', + anonymized_at = '2019-02-07 00:00:00', + bank_debit_form = 'null', + billing_country = 'null', + calc_vat_from = 0, + cancel_id = 56, + cash_allowance = 1.337, + cash_allowance_days = 56, + cash_allowance_text = 'null', + contact_id = 56, + contact_label = '', + contact_text = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + currency = 'EUR', + customer_id = 56, + customer_snapshot = null, + discount = 'null', + discount_type = 'PERCENT', + document_date = 'Thu Feb 07 00:00:00 UTC 2019', + due_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + edited_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + external_id = 'null', + replica_url = 'null', + grace_period = 56, + due_in_days = 56, + id = 56, + is_acceptable_on_public_domain = False, + is_archive = False, + is_draft = True, + is_replica = False, + is_oss = False, + item_notes = [ + '' + ], + items = [ + easybill_generated_async.models.document_position.DocumentPosition( + number = 'null', + description = 'null', + document_note = 'Test Note', + quantity = 1.0, + quantity_str = '1:30 h', + unit = 'null', + type = 'POSITION', + position = 1, + single_price_net = 75.0, + single_price_gross = 1.337, + vat_percent = 0.0, + discount = 10.0, + discount_type = 'PERCENT', + position_id = 123456, + total_price_net = 1.337, + total_price_gross = 1.337, + total_vat = 1.337, + serial_number_id = 'SN-2023-001-ID', + serial_number = 'SN-2023-001', + booking_account = 'null', + export_cost_1 = 'null', + export_cost_2 = 'null', + cost_price_net = 45.5, + cost_price_total = 45.5, + cost_price_charge = 10.0, + cost_price_charge_type = 'PERCENT', + item_type = 'UNDEFINED', + id = 56, ) + ], + last_postbox_id = 56, + login_id = 56, + number = 'null', + order_number = '', + buyer_reference = '', + paid_amount = 56, + paid_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + pdf_pages = 56, + pdf_template = 'null', + payment_link_enabled = False, + payment_link_locale = 'de', + project_id = 56, + recurring_options = easybill_generated_async.models.document_recurring.DocumentRecurring( + next_date = 'Sat Feb 01 00:00:00 UTC 2020', + frequency = 'MONTHLY', + frequency_special = 'LASTDAYOFMONTH', + interval = 1, + end_date_or_count = 'null', + status = 'WAITING', + as_draft = True, + is_notify = True, + send_as = 'EMAIL', + is_sign = True, + is_paid = True, + paid_date_option = 'created_date', + is_sepa = True, + sepa_local_instrument = 'CORE', + sepa_sequence_type = 'FRST', + sepa_reference = 'null', + sepa_remittance_information = 'null', + target_type = 'INVOICE', ), + ref_id = 56, + root_id = 56, + service_date = easybill_generated_async.models.service_date.ServiceDate( + type = 'DEFAULT', + date = 'Fri Feb 01 00:00:00 UTC 2019', + date_from = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + date_to = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + text = 'null', ), + shipping_country = 'null', + status = 'ACCEPT', + text = 'Vielen Dank für Ihren Auftrag! + +Bitte begleichen Sie den offenen Betrag bis zum %DOKUMENT.DATUM-FAELLIG%. + +Mit freundlichen Grüßen + +%FIRMA.FIRMA% +', + text_prefix = '%KUNDE.ANREDE%, +nachfolgend berechnen wir Ihnen wie vorab besprochen: +', + text_tax = 'null', + title = 'null', + type = 'INVOICE', + use_shipping_address = False, + vat_country = 'null', + vat_id = '', + fulfillment_country = 'null', + vat_option = 'NULL', + file_format_config = [ + easybill_generated_async.models.file_format_config.FileFormatConfig( + type = 'default', ) + ], ) + ] + ) + else: + return Documents( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testDocuments(self): + """Test Documents""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_file_format_config.py b/generated/async/test/test_file_format_config.py new file mode 100644 index 0000000..ab8c123 --- /dev/null +++ b/generated/async/test/test_file_format_config.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.file_format_config import FileFormatConfig + +class TestFileFormatConfig(unittest.TestCase): + """FileFormatConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FileFormatConfig: + """Test FileFormatConfig + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FileFormatConfig` + """ + model = FileFormatConfig() + if include_optional: + return FileFormatConfig( + type = 'default' + ) + else: + return FileFormatConfig( + type = 'default', + ) + """ + + def testFileFormatConfig(self): + """Test FileFormatConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_list.py b/generated/async/test/test_list.py new file mode 100644 index 0000000..b2dcb91 --- /dev/null +++ b/generated/async/test/test_list.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.list import List + +class TestList(unittest.TestCase): + """List unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> List: + """Test List + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `List` + """ + model = List() + if include_optional: + return List( + page = 1, + pages = 1, + limit = 100, + total = 20 + ) + else: + return List( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testList(self): + """Test List""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_login.py b/generated/async/test/test_login.py new file mode 100644 index 0000000..f6f4bee --- /dev/null +++ b/generated/async/test/test_login.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.login import Login + +class TestLogin(unittest.TestCase): + """Login unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Login: + """Test Login + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Login` + """ + model = Login() + if include_optional: + return Login( + id = 56, + first_name = 'Max', + last_name = 'Musterfrau', + display_name = 'Max Musterfrau', + phone = '+4923489342', + email = 'example@easybill.de', + email_signature = 'null', + login_type = 'ASSISTANT', + locale = 'de', + time_zone = 'Europe/Berlin', + security = easybill_generated_async.models.login_security.LoginSecurity( + two_factor_enabled = True, + recovery_codes_enabled = True, + notify_on_new_login_enabled = True, ) + ) + else: + return Login( + ) + """ + + def testLogin(self): + """Test Login""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_login_security.py b/generated/async/test/test_login_security.py new file mode 100644 index 0000000..ebd638c --- /dev/null +++ b/generated/async/test/test_login_security.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.login_security import LoginSecurity + +class TestLoginSecurity(unittest.TestCase): + """LoginSecurity unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LoginSecurity: + """Test LoginSecurity + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LoginSecurity` + """ + model = LoginSecurity() + if include_optional: + return LoginSecurity( + two_factor_enabled = True, + recovery_codes_enabled = True, + notify_on_new_login_enabled = True + ) + else: + return LoginSecurity( + ) + """ + + def testLoginSecurity(self): + """Test LoginSecurity""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_logins.py b/generated/async/test/test_logins.py new file mode 100644 index 0000000..9cd2ef7 --- /dev/null +++ b/generated/async/test/test_logins.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.logins import Logins + +class TestLogins(unittest.TestCase): + """Logins unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Logins: + """Test Logins + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Logins` + """ + model = Logins() + if include_optional: + return Logins( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.login.Login( + id = 56, + first_name = 'Max', + last_name = 'Musterfrau', + display_name = 'Max Musterfrau', + phone = '+4923489342', + email = 'example@easybill.de', + email_signature = 'null', + login_type = 'ASSISTANT', + locale = 'de', + time_zone = 'Europe/Berlin', + security = easybill_generated_async.models.login_security.LoginSecurity( + two_factor_enabled = True, + recovery_codes_enabled = True, + notify_on_new_login_enabled = True, ), ) + ] + ) + else: + return Logins( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testLogins(self): + """Test Logins""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_logins_api.py b/generated/async/test/test_logins_api.py new file mode 100644 index 0000000..cc1dd44 --- /dev/null +++ b/generated/async/test/test_logins_api.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.logins_api import LoginsApi + + +class TestLoginsApi(unittest.IsolatedAsyncioTestCase): + """LoginsApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = LoginsApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_logins_get(self) -> None: + """Test case for logins_get + + """ + pass + + async def test_logins_id_get(self) -> None: + """Test case for logins_id_get + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_pdf_template.py b/generated/async/test/test_pdf_template.py new file mode 100644 index 0000000..450d7d7 --- /dev/null +++ b/generated/async/test/test_pdf_template.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.pdf_template import PDFTemplate + +class TestPDFTemplate(unittest.TestCase): + """PDFTemplate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PDFTemplate: + """Test PDFTemplate + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PDFTemplate` + """ + model = PDFTemplate() + if include_optional: + return PDFTemplate( + id = 'INVOICE-DE', + name = 'Default template', + pdf_template = 'DE', + document_type = 'INVOICE', + settings = easybill_generated_async.models.pdf_template_settings.PDFTemplate_settings( + text_prefix = '', + text = '', + email = easybill_generated_async.models.pdf_template_settings_email.PDFTemplate_settings_email( + subject = '', + message = '', ), ) + ) + else: + return PDFTemplate( + ) + """ + + def testPDFTemplate(self): + """Test PDFTemplate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_pdf_template_settings.py b/generated/async/test/test_pdf_template_settings.py new file mode 100644 index 0000000..7dc965d --- /dev/null +++ b/generated/async/test/test_pdf_template_settings.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.pdf_template_settings import PDFTemplateSettings + +class TestPDFTemplateSettings(unittest.TestCase): + """PDFTemplateSettings unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PDFTemplateSettings: + """Test PDFTemplateSettings + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PDFTemplateSettings` + """ + model = PDFTemplateSettings() + if include_optional: + return PDFTemplateSettings( + text_prefix = '', + text = '', + email = easybill_generated_async.models.pdf_template_settings_email.PDFTemplate_settings_email( + subject = '', + message = '', ) + ) + else: + return PDFTemplateSettings( + ) + """ + + def testPDFTemplateSettings(self): + """Test PDFTemplateSettings""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_pdf_template_settings_email.py b/generated/async/test/test_pdf_template_settings_email.py new file mode 100644 index 0000000..0120389 --- /dev/null +++ b/generated/async/test/test_pdf_template_settings_email.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.pdf_template_settings_email import PDFTemplateSettingsEmail + +class TestPDFTemplateSettingsEmail(unittest.TestCase): + """PDFTemplateSettingsEmail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PDFTemplateSettingsEmail: + """Test PDFTemplateSettingsEmail + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PDFTemplateSettingsEmail` + """ + model = PDFTemplateSettingsEmail() + if include_optional: + return PDFTemplateSettingsEmail( + subject = '', + message = '' + ) + else: + return PDFTemplateSettingsEmail( + ) + """ + + def testPDFTemplateSettingsEmail(self): + """Test PDFTemplateSettingsEmail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_pdf_templates.py b/generated/async/test/test_pdf_templates.py new file mode 100644 index 0000000..a2f2be9 --- /dev/null +++ b/generated/async/test/test_pdf_templates.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.pdf_templates import PDFTemplates + +class TestPDFTemplates(unittest.TestCase): + """PDFTemplates unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PDFTemplates: + """Test PDFTemplates + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PDFTemplates` + """ + model = PDFTemplates() + if include_optional: + return PDFTemplates( + items = [ + easybill_generated_async.models.pdf_template.PDFTemplate( + id = 'INVOICE-DE', + name = 'Default template', + pdf_template = 'DE', + document_type = 'INVOICE', + settings = easybill_generated_async.models.pdf_template_settings.PDFTemplate_settings( + text_prefix = '', + text = '', + email = easybill_generated_async.models.pdf_template_settings_email.PDFTemplate_settings_email( + subject = '', + message = '', ), ), ) + ] + ) + else: + return PDFTemplates( + ) + """ + + def testPDFTemplates(self): + """Test PDFTemplates""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_pdf_templates_api.py b/generated/async/test/test_pdf_templates_api.py new file mode 100644 index 0000000..19d6af6 --- /dev/null +++ b/generated/async/test/test_pdf_templates_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.pdf_templates_api import PdfTemplatesApi + + +class TestPdfTemplatesApi(unittest.IsolatedAsyncioTestCase): + """PdfTemplatesApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = PdfTemplatesApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_pdf_templates_get(self) -> None: + """Test case for pdf_templates_get + + Fetch PDF Templates list + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_position.py b/generated/async/test/test_position.py new file mode 100644 index 0000000..95b4c6e --- /dev/null +++ b/generated/async/test/test_position.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.position import Position + +class TestPosition(unittest.TestCase): + """Position unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Position: + """Test Position + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Position` + """ + model = Position() + if include_optional: + return Position( + id = 56, + type = 'PRODUCT', + number = '1234', + description = 'iPhone X', + document_note = 'Test Note', + note = 'null', + unit = 'null', + export_identifier = 'null', + export_identifier_extended = easybill_generated_async.models.position_export_identifier_extended.PositionExportIdentifierExtended( + null = 'null', + n_stb = 'null', + n_stb_ust_id = 'null', + n_stb_none_ust_id = 'null', + n_stb_im = 'null', + revc = 'null', + ig = 'null', + al = 'null', + s_stfr = 'null', + small_business = 'null', ), + login_id = 56, + price_type = 'NETTO', + vat_percent = 19.0, + sale_price = 1250.0, + sale_price2 = 1.337, + sale_price3 = 1.337, + sale_price4 = 1.337, + sale_price5 = 1.337, + sale_price6 = 1.337, + sale_price7 = 1.337, + sale_price8 = 1.337, + sale_price9 = 1.337, + sale_price10 = 1.337, + cost_price = 830.0, + export_cost1 = 'null', + export_cost2 = 'null', + group_id = 56, + stock = 'NO', + stock_count = 100, + stock_limit_notify = True, + stock_limit_notify_frequency = 'ALWAYS', + stock_limit = 50, + quantity = 10.0, + archived = False + ) + else: + return Position( + number = '1234', + description = 'iPhone X', + sale_price = 1250.0, + ) + """ + + def testPosition(self): + """Test Position""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_position_api.py b/generated/async/test/test_position_api.py new file mode 100644 index 0000000..2e28df3 --- /dev/null +++ b/generated/async/test/test_position_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.position_api import PositionApi + + +class TestPositionApi(unittest.IsolatedAsyncioTestCase): + """PositionApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = PositionApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_positions_get(self) -> None: + """Test case for positions_get + + Fetch positions list + """ + pass + + async def test_positions_id_delete(self) -> None: + """Test case for positions_id_delete + + Delete position + """ + pass + + async def test_positions_id_get(self) -> None: + """Test case for positions_id_get + + Fetch position + """ + pass + + async def test_positions_id_put(self) -> None: + """Test case for positions_id_put + + Update position + """ + pass + + async def test_positions_post(self) -> None: + """Test case for positions_post + + Create position + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_position_export_identifier_extended.py b/generated/async/test/test_position_export_identifier_extended.py new file mode 100644 index 0000000..434d130 --- /dev/null +++ b/generated/async/test/test_position_export_identifier_extended.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.position_export_identifier_extended import PositionExportIdentifierExtended + +class TestPositionExportIdentifierExtended(unittest.TestCase): + """PositionExportIdentifierExtended unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PositionExportIdentifierExtended: + """Test PositionExportIdentifierExtended + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PositionExportIdentifierExtended` + """ + model = PositionExportIdentifierExtended() + if include_optional: + return PositionExportIdentifierExtended( + null = 'null', + n_stb = 'null', + n_stb_ust_id = 'null', + n_stb_none_ust_id = 'null', + n_stb_im = 'null', + revc = 'null', + ig = 'null', + al = 'null', + s_stfr = 'null', + small_business = 'null' + ) + else: + return PositionExportIdentifierExtended( + ) + """ + + def testPositionExportIdentifierExtended(self): + """Test PositionExportIdentifierExtended""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_position_group.py b/generated/async/test/test_position_group.py new file mode 100644 index 0000000..dc8376e --- /dev/null +++ b/generated/async/test/test_position_group.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.position_group import PositionGroup + +class TestPositionGroup(unittest.TestCase): + """PositionGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PositionGroup: + """Test PositionGroup + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PositionGroup` + """ + model = PositionGroup() + if include_optional: + return PositionGroup( + description = 'null', + login_id = 56, + name = 'Mobile Phones', + number = '001', + display_name = '001 - Mobile Phones', + id = 56 + ) + else: + return PositionGroup( + name = 'Mobile Phones', + number = '001', + ) + """ + + def testPositionGroup(self): + """Test PositionGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_position_group_api.py b/generated/async/test/test_position_group_api.py new file mode 100644 index 0000000..73b1f2e --- /dev/null +++ b/generated/async/test/test_position_group_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.position_group_api import PositionGroupApi + + +class TestPositionGroupApi(unittest.IsolatedAsyncioTestCase): + """PositionGroupApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = PositionGroupApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_position_groups_get(self) -> None: + """Test case for position_groups_get + + Fetch position group list + """ + pass + + async def test_position_groups_id_delete(self) -> None: + """Test case for position_groups_id_delete + + Delete position group + """ + pass + + async def test_position_groups_id_get(self) -> None: + """Test case for position_groups_id_get + + Fetch position group + """ + pass + + async def test_position_groups_id_put(self) -> None: + """Test case for position_groups_id_put + + Update position group + """ + pass + + async def test_position_groups_post(self) -> None: + """Test case for position_groups_post + + Create position group + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_position_groups.py b/generated/async/test/test_position_groups.py new file mode 100644 index 0000000..b9af992 --- /dev/null +++ b/generated/async/test/test_position_groups.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.position_groups import PositionGroups + +class TestPositionGroups(unittest.TestCase): + """PositionGroups unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PositionGroups: + """Test PositionGroups + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PositionGroups` + """ + model = PositionGroups() + if include_optional: + return PositionGroups( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.position_group.PositionGroup( + description = 'null', + login_id = 56, + name = 'Mobile Phones', + number = '001', + display_name = '001 - Mobile Phones', + id = 56, ) + ] + ) + else: + return PositionGroups( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testPositionGroups(self): + """Test PositionGroups""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_positions.py b/generated/async/test/test_positions.py new file mode 100644 index 0000000..13fc8b7 --- /dev/null +++ b/generated/async/test/test_positions.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.positions import Positions + +class TestPositions(unittest.TestCase): + """Positions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Positions: + """Test Positions + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Positions` + """ + model = Positions() + if include_optional: + return Positions( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.position.Position( + id = 56, + type = 'PRODUCT', + number = '1234', + description = 'iPhone X', + document_note = 'Test Note', + note = 'null', + unit = 'null', + export_identifier = 'null', + export_identifier_extended = easybill_generated_async.models.position_export_identifier_extended.PositionExportIdentifierExtended( + null = 'null', + n_stb = 'null', + n_stb_ust_id = 'null', + n_stb_none_ust_id = 'null', + n_stb_im = 'null', + revc = 'null', + ig = 'null', + al = 'null', + s_stfr = 'null', + small_business = 'null', ), + login_id = 56, + price_type = 'NETTO', + vat_percent = 19.0, + sale_price = 1250.0, + sale_price2 = 1.337, + sale_price3 = 1.337, + sale_price4 = 1.337, + sale_price5 = 1.337, + sale_price6 = 1.337, + sale_price7 = 1.337, + sale_price8 = 1.337, + sale_price9 = 1.337, + sale_price10 = 1.337, + cost_price = 830.0, + export_cost1 = 'null', + export_cost2 = 'null', + group_id = 56, + stock = 'NO', + stock_count = 100, + stock_limit_notify = True, + stock_limit_notify_frequency = 'ALWAYS', + stock_limit = 50, + quantity = 10.0, + archived = False, ) + ] + ) + else: + return Positions( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testPositions(self): + """Test Positions""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_post_box.py b/generated/async/test/test_post_box.py new file mode 100644 index 0000000..73f6e32 --- /dev/null +++ b/generated/async/test/test_post_box.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.post_box import PostBox + +class TestPostBox(unittest.TestCase): + """PostBox unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PostBox: + """Test PostBox + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PostBox` + """ + model = PostBox() + if include_optional: + return PostBox( + id = 56, + document_id = 56, + to = 'example@easybill.de', + cc = 'null', + var_from = 'example@easybill.de', + subject = 'Invoice', + message = 'Dear Mr. ...', + var_date = 'Thu Feb 07 00:00:00 UTC 2019', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + processed_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + send_by_self = False, + send_with_attachment = True, + type = 'EMAIL', + status = 'WAITING', + status_msg = 'null', + login_id = 56, + document_file_type = 'default', + post_send_type = 'post_send_type_standard', + tracking_identifier = 'DE1234567890' + ) + else: + return PostBox( + ) + """ + + def testPostBox(self): + """Test PostBox""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_post_box_api.py b/generated/async/test/test_post_box_api.py new file mode 100644 index 0000000..9468367 --- /dev/null +++ b/generated/async/test/test_post_box_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.post_box_api import PostBoxApi + + +class TestPostBoxApi(unittest.IsolatedAsyncioTestCase): + """PostBoxApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = PostBoxApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_post_boxes_get(self) -> None: + """Test case for post_boxes_get + + Fetch post box list + """ + pass + + async def test_post_boxes_id_delete(self) -> None: + """Test case for post_boxes_id_delete + + Delete post box + """ + pass + + async def test_post_boxes_id_get(self) -> None: + """Test case for post_boxes_id_get + + Fetch post box + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_post_box_request.py b/generated/async/test/test_post_box_request.py new file mode 100644 index 0000000..f05e95c --- /dev/null +++ b/generated/async/test/test_post_box_request.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.post_box_request import PostBoxRequest + +class TestPostBoxRequest(unittest.TestCase): + """PostBoxRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PostBoxRequest: + """Test PostBoxRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PostBoxRequest` + """ + model = PostBoxRequest() + if include_optional: + return PostBoxRequest( + to = '', + cc = '', + var_from = '', + subject = '', + message = '', + var_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + send_by_self = False, + send_with_attachment = True, + document_file_type = 'default', + post_send_type = 'post_send_type_standard' + ) + else: + return PostBoxRequest( + ) + """ + + def testPostBoxRequest(self): + """Test PostBoxRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_post_boxes.py b/generated/async/test/test_post_boxes.py new file mode 100644 index 0000000..42a3ea3 --- /dev/null +++ b/generated/async/test/test_post_boxes.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.post_boxes import PostBoxes + +class TestPostBoxes(unittest.TestCase): + """PostBoxes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PostBoxes: + """Test PostBoxes + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PostBoxes` + """ + model = PostBoxes() + if include_optional: + return PostBoxes( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.post_box.PostBox( + id = 56, + document_id = 56, + to = 'example@easybill.de', + cc = 'null', + from = 'example@easybill.de', + subject = 'Invoice', + message = 'Dear Mr. ...', + date = 'Thu Feb 07 00:00:00 UTC 2019', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + processed_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + send_by_self = False, + send_with_attachment = True, + type = 'EMAIL', + status = 'WAITING', + status_msg = 'null', + login_id = 56, + document_file_type = 'default', + post_send_type = 'post_send_type_standard', + tracking_identifier = 'DE1234567890', ) + ] + ) + else: + return PostBoxes( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testPostBoxes(self): + """Test PostBoxes""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_project.py b/generated/async/test/test_project.py new file mode 100644 index 0000000..60545a9 --- /dev/null +++ b/generated/async/test/test_project.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.project import Project + +class TestProject(unittest.TestCase): + """Project unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Project: + """Test Project + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Project` + """ + model = Project() + if include_optional: + return Project( + budget_amount = 10000, + budget_time = 60, + customer_id = 56, + hourly_rate = 3000.0, + id = 56, + login_id = 56, + name = 'My Project', + note = 'null', + status = 'OPEN', + due_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + budget_notify_frequency = 'ALWAYS', + consumed_time = 56, + consumed_amount = 56 + ) + else: + return Project( + name = 'My Project', + ) + """ + + def testProject(self): + """Test Project""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_project_api.py b/generated/async/test/test_project_api.py new file mode 100644 index 0000000..407aa38 --- /dev/null +++ b/generated/async/test/test_project_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.project_api import ProjectApi + + +class TestProjectApi(unittest.IsolatedAsyncioTestCase): + """ProjectApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = ProjectApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_projects_get(self) -> None: + """Test case for projects_get + + Fetch projects list + """ + pass + + async def test_projects_id_delete(self) -> None: + """Test case for projects_id_delete + + Delete project + """ + pass + + async def test_projects_id_get(self) -> None: + """Test case for projects_id_get + + Fetch project + """ + pass + + async def test_projects_id_put(self) -> None: + """Test case for projects_id_put + + Update project + """ + pass + + async def test_projects_post(self) -> None: + """Test case for projects_post + + Create project + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_projects.py b/generated/async/test/test_projects.py new file mode 100644 index 0000000..cdbe15c --- /dev/null +++ b/generated/async/test/test_projects.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.projects import Projects + +class TestProjects(unittest.TestCase): + """Projects unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Projects: + """Test Projects + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Projects` + """ + model = Projects() + if include_optional: + return Projects( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.project.Project( + budget_amount = 10000, + budget_time = 60, + customer_id = 56, + hourly_rate = 3000.0, + id = 56, + login_id = 56, + name = 'My Project', + note = 'null', + status = 'OPEN', + due_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + budget_notify_frequency = 'ALWAYS', + consumed_time = 56, + consumed_amount = 56, ) + ] + ) + else: + return Projects( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testProjects(self): + """Test Projects""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_sepa_payment.py b/generated/async/test/test_sepa_payment.py new file mode 100644 index 0000000..206489f --- /dev/null +++ b/generated/async/test/test_sepa_payment.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.sepa_payment import SEPAPayment + +class TestSEPAPayment(unittest.TestCase): + """SEPAPayment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SEPAPayment: + """Test SEPAPayment + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SEPAPayment` + """ + model = SEPAPayment() + if include_optional: + return SEPAPayment( + amount = 10000, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + creditor_bic = 'null', + creditor_iban = 'DE12345678901234567890', + creditor_name = 'Easybill GmbH', + debitor_bic = 'null', + debitor_iban = 'DE12345678901234567890', + debitor_name = 'Easybill GmbH', + debitor_address_line_1 = 'Bahnhofstr. 1', + debitor_address_line2 = '8001 Zürich', + debitor_country = 'CH', + document_id = 56, + export_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + export_error = 'null', + id = 56, + local_instrument = 'CORE', + mandate_date_of_signature = 'Fri Feb 01 00:00:00 UTC 2019', + mandate_id = '001', + reference = 'X000000001', + remittance_information = 'null', + requested_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + sequence_type = 'FRST', + updated_at = '2018-01-01 23:23:45', + type = 'DEBIT' + ) + else: + return SEPAPayment( + amount = 10000, + debitor_iban = 'DE12345678901234567890', + debitor_name = 'Easybill GmbH', + document_id = 56, + local_instrument = 'CORE', + mandate_date_of_signature = 'Fri Feb 01 00:00:00 UTC 2019', + mandate_id = '001', + reference = 'X000000001', + sequence_type = 'FRST', + ) + """ + + def testSEPAPayment(self): + """Test SEPAPayment""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_sepa_payment_api.py b/generated/async/test/test_sepa_payment_api.py new file mode 100644 index 0000000..ffcfc38 --- /dev/null +++ b/generated/async/test/test_sepa_payment_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.sepa_payment_api import SepaPaymentApi + + +class TestSepaPaymentApi(unittest.IsolatedAsyncioTestCase): + """SepaPaymentApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = SepaPaymentApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_sepa_payments_get(self) -> None: + """Test case for sepa_payments_get + + Fetch SEPA payments list + """ + pass + + async def test_sepa_payments_id_delete(self) -> None: + """Test case for sepa_payments_id_delete + + Delete SEPA payment + """ + pass + + async def test_sepa_payments_id_get(self) -> None: + """Test case for sepa_payments_id_get + + Fetch SEPA payment + """ + pass + + async def test_sepa_payments_id_put(self) -> None: + """Test case for sepa_payments_id_put + + Update SEPA payment + """ + pass + + async def test_sepa_payments_post(self) -> None: + """Test case for sepa_payments_post + + Create SEPA payment + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_sepa_payments.py b/generated/async/test/test_sepa_payments.py new file mode 100644 index 0000000..d07ac71 --- /dev/null +++ b/generated/async/test/test_sepa_payments.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.sepa_payments import SEPAPayments + +class TestSEPAPayments(unittest.TestCase): + """SEPAPayments unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SEPAPayments: + """Test SEPAPayments + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SEPAPayments` + """ + model = SEPAPayments() + if include_optional: + return SEPAPayments( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.sepa_payment.SEPAPayment( + amount = 10000, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + creditor_bic = 'null', + creditor_iban = 'DE12345678901234567890', + creditor_name = 'Easybill GmbH', + debitor_bic = 'null', + debitor_iban = 'DE12345678901234567890', + debitor_name = 'Easybill GmbH', + debitor_address_line_1 = 'Bahnhofstr. 1', + debitor_address_line2 = '8001 Zürich', + debitor_country = 'CH', + document_id = 56, + export_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + export_error = 'null', + id = 56, + local_instrument = 'CORE', + mandate_date_of_signature = 'Fri Feb 01 00:00:00 UTC 2019', + mandate_id = '001', + reference = 'X000000001', + remittance_information = 'null', + requested_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + sequence_type = 'FRST', + updated_at = '2018-01-01 23:23:45', + type = 'DEBIT', ) + ] + ) + else: + return SEPAPayments( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testSEPAPayments(self): + """Test SEPAPayments""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_serial_number.py b/generated/async/test/test_serial_number.py new file mode 100644 index 0000000..e9ce499 --- /dev/null +++ b/generated/async/test/test_serial_number.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.serial_number import SerialNumber + +class TestSerialNumber(unittest.TestCase): + """SerialNumber unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SerialNumber: + """Test SerialNumber + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SerialNumber` + """ + model = SerialNumber() + if include_optional: + return SerialNumber( + id = 56, + serial_number = 'DHEZ-DHSNR-2344D-FFW', + position_id = 56, + document_id = 56, + document_position_id = 56, + used_at = 'null', + created_at = '2018-01-01 23:23:45' + ) + else: + return SerialNumber( + serial_number = 'DHEZ-DHSNR-2344D-FFW', + position_id = 56, + ) + """ + + def testSerialNumber(self): + """Test SerialNumber""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_serial_number_api.py b/generated/async/test/test_serial_number_api.py new file mode 100644 index 0000000..cf4752a --- /dev/null +++ b/generated/async/test/test_serial_number_api.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.serial_number_api import SerialNumberApi + + +class TestSerialNumberApi(unittest.IsolatedAsyncioTestCase): + """SerialNumberApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = SerialNumberApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_serial_numbers_get(self) -> None: + """Test case for serial_numbers_get + + Fetch a list of serial numbers for positions + """ + pass + + async def test_serial_numbers_id_delete(self) -> None: + """Test case for serial_numbers_id_delete + + Delete a serial number for a position + """ + pass + + async def test_serial_numbers_id_get(self) -> None: + """Test case for serial_numbers_id_get + + Fetch a serial number for a position + """ + pass + + async def test_serial_numbers_post(self) -> None: + """Test case for serial_numbers_post + + Create s serial number for a position + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_serial_numbers.py b/generated/async/test/test_serial_numbers.py new file mode 100644 index 0000000..dd9030f --- /dev/null +++ b/generated/async/test/test_serial_numbers.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.serial_numbers import SerialNumbers + +class TestSerialNumbers(unittest.TestCase): + """SerialNumbers unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SerialNumbers: + """Test SerialNumbers + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SerialNumbers` + """ + model = SerialNumbers() + if include_optional: + return SerialNumbers( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.serial_number.SerialNumber( + id = 56, + serial_number = 'DHEZ-DHSNR-2344D-FFW', + position_id = 56, + document_id = 56, + document_position_id = 56, + used_at = 'null', + created_at = '2018-01-01 23:23:45', ) + ] + ) + else: + return SerialNumbers( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testSerialNumbers(self): + """Test SerialNumbers""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_service_date.py b/generated/async/test/test_service_date.py new file mode 100644 index 0000000..3829209 --- /dev/null +++ b/generated/async/test/test_service_date.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.service_date import ServiceDate + +class TestServiceDate(unittest.TestCase): + """ServiceDate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ServiceDate: + """Test ServiceDate + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ServiceDate` + """ + model = ServiceDate() + if include_optional: + return ServiceDate( + type = 'DEFAULT', + var_date = 'Fri Feb 01 00:00:00 UTC 2019', + date_from = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + date_to = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + text = 'null' + ) + else: + return ServiceDate( + ) + """ + + def testServiceDate(self): + """Test ServiceDate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_stock.py b/generated/async/test/test_stock.py new file mode 100644 index 0000000..6957102 --- /dev/null +++ b/generated/async/test/test_stock.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.stock import Stock + +class TestStock(unittest.TestCase): + """Stock unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Stock: + """Test Stock + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Stock` + """ + model = Stock() + if include_optional: + return Stock( + id = 56, + note = 'Correction for stock count of the Entry from 11/01/2017', + stock_count = 666, + position_id = 56, + document_id = 56, + document_position_id = 56, + stored_at = '2017-04-11 13:00:00', + created_at = '2018-01-01 23:23:45', + updated_at = '2018-01-01 23:23:45' + ) + else: + return Stock( + stock_count = 666, + position_id = 56, + ) + """ + + def testStock(self): + """Test Stock""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_stock_api.py b/generated/async/test/test_stock_api.py new file mode 100644 index 0000000..6492652 --- /dev/null +++ b/generated/async/test/test_stock_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.stock_api import StockApi + + +class TestStockApi(unittest.IsolatedAsyncioTestCase): + """StockApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = StockApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_stocks_get(self) -> None: + """Test case for stocks_get + + Fetch a list of stock entries for positions + """ + pass + + async def test_stocks_id_get(self) -> None: + """Test case for stocks_id_get + + Fetch an stock entry for a position + """ + pass + + async def test_stocks_post(self) -> None: + """Test case for stocks_post + + Create a stock entry for a position + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_stocks.py b/generated/async/test/test_stocks.py new file mode 100644 index 0000000..b9ac405 --- /dev/null +++ b/generated/async/test/test_stocks.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.stocks import Stocks + +class TestStocks(unittest.TestCase): + """Stocks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Stocks: + """Test Stocks + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Stocks` + """ + model = Stocks() + if include_optional: + return Stocks( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.stock.Stock( + id = 56, + note = 'Correction for stock count of the Entry from 11/01/2017', + stock_count = 666, + position_id = 56, + document_id = 56, + document_position_id = 56, + stored_at = '2017-04-11 13:00:00', + created_at = '2018-01-01 23:23:45', + updated_at = '2018-01-01 23:23:45', ) + ] + ) + else: + return Stocks( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testStocks(self): + """Test Stocks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_task.py b/generated/async/test/test_task.py new file mode 100644 index 0000000..912a3ef --- /dev/null +++ b/generated/async/test/test_task.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.task import Task + +class TestTask(unittest.TestCase): + """Task unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Task: + """Test Task + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Task` + """ + model = Task() + if include_optional: + return Task( + category = 'CALL', + category_custom = 'null', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_id = 56, + description = 'null', + document_id = 56, + end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + finish_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + id = 56, + login_id = 56, + name = 'Call client', + position_id = 56, + priority = 'NORMAL', + project_id = 56, + start_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + status = 'PROCESSING', + status_percent = 50 + ) + else: + return Task( + name = 'Call client', + status = 'PROCESSING', + ) + """ + + def testTask(self): + """Test Task""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_task_api.py b/generated/async/test/test_task_api.py new file mode 100644 index 0000000..d3b3ace --- /dev/null +++ b/generated/async/test/test_task_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.task_api import TaskApi + + +class TestTaskApi(unittest.IsolatedAsyncioTestCase): + """TaskApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = TaskApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_tasks_get(self) -> None: + """Test case for tasks_get + + Fetch tasks list + """ + pass + + async def test_tasks_id_delete(self) -> None: + """Test case for tasks_id_delete + + Delete task + """ + pass + + async def test_tasks_id_get(self) -> None: + """Test case for tasks_id_get + + Fetch task + """ + pass + + async def test_tasks_id_put(self) -> None: + """Test case for tasks_id_put + + Update task + """ + pass + + async def test_tasks_post(self) -> None: + """Test case for tasks_post + + Create task + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_tasks.py b/generated/async/test/test_tasks.py new file mode 100644 index 0000000..fb5bd20 --- /dev/null +++ b/generated/async/test/test_tasks.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.tasks import Tasks + +class TestTasks(unittest.TestCase): + """Tasks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Tasks: + """Test Tasks + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Tasks` + """ + model = Tasks() + if include_optional: + return Tasks( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.task.Task( + category = 'CALL', + category_custom = 'null', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_id = 56, + description = 'null', + document_id = 56, + end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + finish_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + id = 56, + login_id = 56, + name = 'Call client', + position_id = 56, + priority = 'NORMAL', + project_id = 56, + start_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + status = 'PROCESSING', + status_percent = 50, ) + ] + ) + else: + return Tasks( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testTasks(self): + """Test Tasks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_text_template.py b/generated/async/test/test_text_template.py new file mode 100644 index 0000000..08b9aa0 --- /dev/null +++ b/generated/async/test/test_text_template.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.text_template import TextTemplate + +class TestTextTemplate(unittest.TestCase): + """TextTemplate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TextTemplate: + """Test TextTemplate + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TextTemplate` + """ + model = TextTemplate() + if include_optional: + return TextTemplate( + can_modify = True, + id = 56, + text = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.', + title = 'Lorem Ipsum' + ) + else: + return TextTemplate( + text = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.', + title = 'Lorem Ipsum', + ) + """ + + def testTextTemplate(self): + """Test TextTemplate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_text_template_api.py b/generated/async/test/test_text_template_api.py new file mode 100644 index 0000000..91d8d09 --- /dev/null +++ b/generated/async/test/test_text_template_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.text_template_api import TextTemplateApi + + +class TestTextTemplateApi(unittest.IsolatedAsyncioTestCase): + """TextTemplateApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = TextTemplateApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_text_templates_get(self) -> None: + """Test case for text_templates_get + + Fetch text templates list + """ + pass + + async def test_text_templates_id_delete(self) -> None: + """Test case for text_templates_id_delete + + Delete text template + """ + pass + + async def test_text_templates_id_get(self) -> None: + """Test case for text_templates_id_get + + Fetch text template + """ + pass + + async def test_text_templates_id_put(self) -> None: + """Test case for text_templates_id_put + + Update text template + """ + pass + + async def test_text_templates_post(self) -> None: + """Test case for text_templates_post + + Create text template + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_text_templates.py b/generated/async/test/test_text_templates.py new file mode 100644 index 0000000..5e5e54f --- /dev/null +++ b/generated/async/test/test_text_templates.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.text_templates import TextTemplates + +class TestTextTemplates(unittest.TestCase): + """TextTemplates unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TextTemplates: + """Test TextTemplates + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TextTemplates` + """ + model = TextTemplates() + if include_optional: + return TextTemplates( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.text_template.TextTemplate( + can_modify = True, + id = 56, + text = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.', + title = 'Lorem Ipsum', ) + ] + ) + else: + return TextTemplates( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testTextTemplates(self): + """Test TextTemplates""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_time_tracking.py b/generated/async/test/test_time_tracking.py new file mode 100644 index 0000000..cc0dce1 --- /dev/null +++ b/generated/async/test/test_time_tracking.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.time_tracking import TimeTracking + +class TestTimeTracking(unittest.TestCase): + """TimeTracking unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TimeTracking: + """Test TimeTracking + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TimeTracking` + """ + model = TimeTracking() + if include_optional: + return TimeTracking( + cleared_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + date_from_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + date_thru_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = 'Meeting with client', + hourly_rate = 2000.0, + id = 56, + note = 'null', + number = '001', + position_id = 56, + project_id = 56, + login_id = 56, + timer_value = 90 + ) + else: + return TimeTracking( + description = 'Meeting with client', + ) + """ + + def testTimeTracking(self): + """Test TimeTracking""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_time_tracking_api.py b/generated/async/test/test_time_tracking_api.py new file mode 100644 index 0000000..6f9495e --- /dev/null +++ b/generated/async/test/test_time_tracking_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.time_tracking_api import TimeTrackingApi + + +class TestTimeTrackingApi(unittest.IsolatedAsyncioTestCase): + """TimeTrackingApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = TimeTrackingApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_time_trackings_get(self) -> None: + """Test case for time_trackings_get + + Fetch time trackings list + """ + pass + + async def test_time_trackings_id_delete(self) -> None: + """Test case for time_trackings_id_delete + + Delete time tracking + """ + pass + + async def test_time_trackings_id_get(self) -> None: + """Test case for time_trackings_id_get + + Fetch time tracking + """ + pass + + async def test_time_trackings_id_put(self) -> None: + """Test case for time_trackings_id_put + + Update time tracking + """ + pass + + async def test_time_trackings_post(self) -> None: + """Test case for time_trackings_post + + Create time tracking + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_time_trackings.py b/generated/async/test/test_time_trackings.py new file mode 100644 index 0000000..48728ef --- /dev/null +++ b/generated/async/test/test_time_trackings.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.time_trackings import TimeTrackings + +class TestTimeTrackings(unittest.TestCase): + """TimeTrackings unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TimeTrackings: + """Test TimeTrackings + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TimeTrackings` + """ + model = TimeTrackings() + if include_optional: + return TimeTrackings( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.time_tracking.TimeTracking( + cleared_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + date_from_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + date_thru_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = 'Meeting with client', + hourly_rate = 2000.0, + id = 56, + note = 'null', + number = '001', + position_id = 56, + project_id = 56, + login_id = 56, + timer_value = 90, ) + ] + ) + else: + return TimeTrackings( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testTimeTrackings(self): + """Test TimeTrackings""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_web_hook.py b/generated/async/test/test_web_hook.py new file mode 100644 index 0000000..9aaf627 --- /dev/null +++ b/generated/async/test/test_web_hook.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.web_hook import WebHook + +class TestWebHook(unittest.TestCase): + """WebHook unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebHook: + """Test WebHook + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebHook` + """ + model = WebHook() + if include_optional: + return WebHook( + content_type = 'form', + description = 'My Webhook', + events = [ + 'document.create' + ], + id = 56, + is_active = True, + last_response = easybill_generated_async.models.web_hook_last_response.WebHookLastResponse( + date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + code = 204, + response = '', ), + secret = '', + url = 'https://...' + ) + else: + return WebHook( + content_type = 'form', + description = 'My Webhook', + events = [ + 'document.create' + ], + secret = '', + url = 'https://...', + ) + """ + + def testWebHook(self): + """Test WebHook""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_web_hook_last_response.py b/generated/async/test/test_web_hook_last_response.py new file mode 100644 index 0000000..93b993e --- /dev/null +++ b/generated/async/test/test_web_hook_last_response.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.web_hook_last_response import WebHookLastResponse + +class TestWebHookLastResponse(unittest.TestCase): + """WebHookLastResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebHookLastResponse: + """Test WebHookLastResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebHookLastResponse` + """ + model = WebHookLastResponse() + if include_optional: + return WebHookLastResponse( + var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + code = 204, + response = '' + ) + else: + return WebHookLastResponse( + ) + """ + + def testWebHookLastResponse(self): + """Test WebHookLastResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_web_hooks.py b/generated/async/test/test_web_hooks.py new file mode 100644 index 0000000..e5320da --- /dev/null +++ b/generated/async/test/test_web_hooks.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.models.web_hooks import WebHooks + +class TestWebHooks(unittest.TestCase): + """WebHooks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebHooks: + """Test WebHooks + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebHooks` + """ + model = WebHooks() + if include_optional: + return WebHooks( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_async.models.web_hook.WebHook( + content_type = 'form', + description = 'My Webhook', + events = [ + 'document.create' + ], + id = 56, + is_active = True, + last_response = easybill_generated_async.models.web_hook_last_response.WebHookLastResponse( + date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + code = 204, + response = '', ), + secret = '', + url = 'https://...', ) + ] + ) + else: + return WebHooks( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testWebHooks(self): + """Test WebHooks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/test/test_webhook_api.py b/generated/async/test/test_webhook_api.py new file mode 100644 index 0000000..0bc8448 --- /dev/null +++ b/generated/async/test/test_webhook_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_async.api.webhook_api import WebhookApi + + +class TestWebhookApi(unittest.IsolatedAsyncioTestCase): + """WebhookApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = WebhookApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_webhooks_get(self) -> None: + """Test case for webhooks_get + + Fetch WebHooks list + """ + pass + + async def test_webhooks_id_delete(self) -> None: + """Test case for webhooks_id_delete + + Delete WebHook + """ + pass + + async def test_webhooks_id_get(self) -> None: + """Test case for webhooks_id_get + + Fetch WebHook + """ + pass + + async def test_webhooks_id_put(self) -> None: + """Test case for webhooks_id_put + + Update WebHook + """ + pass + + async def test_webhooks_post(self) -> None: + """Test case for webhooks_post + + Create WebHook + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/async/tox.ini b/generated/async/tox.ini new file mode 100644 index 0000000..7334acf --- /dev/null +++ b/generated/async/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=easybill_generated_async diff --git a/generated/sync/.github/workflows/python.yml b/generated/sync/.github/workflows/python.yml new file mode 100644 index 0000000..242ecd9 --- /dev/null +++ b/generated/sync/.github/workflows/python.yml @@ -0,0 +1,34 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: easybill_generated_sync Python package + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r test-requirements.txt + - name: Test with pytest + run: | + pytest --cov=easybill_generated_sync diff --git a/generated/sync/.gitignore b/generated/sync/.gitignore new file mode 100644 index 0000000..65b06b9 --- /dev/null +++ b/generated/sync/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Ipython Notebook +.ipynb_checkpoints diff --git a/generated/sync/.gitlab-ci.yml b/generated/sync/.gitlab-ci.yml new file mode 100644 index 0000000..c58aecc --- /dev/null +++ b/generated/sync/.gitlab-ci.yml @@ -0,0 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml + +stages: + - test + +.pytest: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=easybill_generated_sync + +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine +pytest-3.12: + extends: .pytest + image: python:3.12-alpine +pytest-3.13: + extends: .pytest + image: python:3.13-alpine +pytest-3.14: + extends: .pytest + image: python:3.14-alpine diff --git a/generated/sync/.openapi-generator-ignore b/generated/sync/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/generated/sync/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/generated/sync/.openapi-generator/FILES b/generated/sync/.openapi-generator/FILES new file mode 100644 index 0000000..4371d72 --- /dev/null +++ b/generated/sync/.openapi-generator/FILES @@ -0,0 +1,266 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +docs/AdvancedDataField.md +docs/Attachment.md +docs/AttachmentApi.md +docs/Attachments.md +docs/Contact.md +docs/ContactApi.md +docs/Contacts.md +docs/Customer.md +docs/CustomerApi.md +docs/CustomerGroup.md +docs/CustomerGroupApi.md +docs/CustomerGroups.md +docs/CustomerSnapshot.md +docs/Customers.md +docs/Discount.md +docs/DiscountApi.md +docs/DiscountPosition.md +docs/DiscountPositionGroup.md +docs/DiscountPositionGroups.md +docs/DiscountPositions.md +docs/Document.md +docs/DocumentAddress.md +docs/DocumentApi.md +docs/DocumentPayment.md +docs/DocumentPaymentApi.md +docs/DocumentPayments.md +docs/DocumentPosition.md +docs/DocumentRecurring.md +docs/DocumentVersion.md +docs/DocumentVersionApi.md +docs/DocumentVersionItem.md +docs/DocumentVersions.md +docs/Documents.md +docs/FileFormatConfig.md +docs/List.md +docs/Login.md +docs/LoginSecurity.md +docs/Logins.md +docs/LoginsApi.md +docs/PDFTemplate.md +docs/PDFTemplateSettings.md +docs/PDFTemplateSettingsEmail.md +docs/PDFTemplates.md +docs/PdfTemplatesApi.md +docs/Position.md +docs/PositionApi.md +docs/PositionExportIdentifierExtended.md +docs/PositionGroup.md +docs/PositionGroupApi.md +docs/PositionGroups.md +docs/Positions.md +docs/PostBox.md +docs/PostBoxApi.md +docs/PostBoxRequest.md +docs/PostBoxes.md +docs/Project.md +docs/ProjectApi.md +docs/Projects.md +docs/SEPAPayment.md +docs/SEPAPayments.md +docs/SepaPaymentApi.md +docs/SerialNumber.md +docs/SerialNumberApi.md +docs/SerialNumbers.md +docs/ServiceDate.md +docs/Stock.md +docs/StockApi.md +docs/Stocks.md +docs/Task.md +docs/TaskApi.md +docs/Tasks.md +docs/TextTemplate.md +docs/TextTemplateApi.md +docs/TextTemplates.md +docs/TimeTracking.md +docs/TimeTrackingApi.md +docs/TimeTrackings.md +docs/WebHook.md +docs/WebHookLastResponse.md +docs/WebHooks.md +docs/WebhookApi.md +easybill_generated_sync/__init__.py +easybill_generated_sync/api/__init__.py +easybill_generated_sync/api/attachment_api.py +easybill_generated_sync/api/contact_api.py +easybill_generated_sync/api/customer_api.py +easybill_generated_sync/api/customer_group_api.py +easybill_generated_sync/api/discount_api.py +easybill_generated_sync/api/document_api.py +easybill_generated_sync/api/document_payment_api.py +easybill_generated_sync/api/document_version_api.py +easybill_generated_sync/api/logins_api.py +easybill_generated_sync/api/pdf_templates_api.py +easybill_generated_sync/api/position_api.py +easybill_generated_sync/api/position_group_api.py +easybill_generated_sync/api/post_box_api.py +easybill_generated_sync/api/project_api.py +easybill_generated_sync/api/sepa_payment_api.py +easybill_generated_sync/api/serial_number_api.py +easybill_generated_sync/api/stock_api.py +easybill_generated_sync/api/task_api.py +easybill_generated_sync/api/text_template_api.py +easybill_generated_sync/api/time_tracking_api.py +easybill_generated_sync/api/webhook_api.py +easybill_generated_sync/api_client.py +easybill_generated_sync/api_response.py +easybill_generated_sync/configuration.py +easybill_generated_sync/exceptions.py +easybill_generated_sync/models/__init__.py +easybill_generated_sync/models/advanced_data_field.py +easybill_generated_sync/models/attachment.py +easybill_generated_sync/models/attachments.py +easybill_generated_sync/models/contact.py +easybill_generated_sync/models/contacts.py +easybill_generated_sync/models/customer.py +easybill_generated_sync/models/customer_group.py +easybill_generated_sync/models/customer_groups.py +easybill_generated_sync/models/customer_snapshot.py +easybill_generated_sync/models/customers.py +easybill_generated_sync/models/discount.py +easybill_generated_sync/models/discount_position.py +easybill_generated_sync/models/discount_position_group.py +easybill_generated_sync/models/discount_position_groups.py +easybill_generated_sync/models/discount_positions.py +easybill_generated_sync/models/document.py +easybill_generated_sync/models/document_address.py +easybill_generated_sync/models/document_payment.py +easybill_generated_sync/models/document_payments.py +easybill_generated_sync/models/document_position.py +easybill_generated_sync/models/document_recurring.py +easybill_generated_sync/models/document_version.py +easybill_generated_sync/models/document_version_item.py +easybill_generated_sync/models/document_versions.py +easybill_generated_sync/models/documents.py +easybill_generated_sync/models/file_format_config.py +easybill_generated_sync/models/list.py +easybill_generated_sync/models/login.py +easybill_generated_sync/models/login_security.py +easybill_generated_sync/models/logins.py +easybill_generated_sync/models/pdf_template.py +easybill_generated_sync/models/pdf_template_settings.py +easybill_generated_sync/models/pdf_template_settings_email.py +easybill_generated_sync/models/pdf_templates.py +easybill_generated_sync/models/position.py +easybill_generated_sync/models/position_export_identifier_extended.py +easybill_generated_sync/models/position_group.py +easybill_generated_sync/models/position_groups.py +easybill_generated_sync/models/positions.py +easybill_generated_sync/models/post_box.py +easybill_generated_sync/models/post_box_request.py +easybill_generated_sync/models/post_boxes.py +easybill_generated_sync/models/project.py +easybill_generated_sync/models/projects.py +easybill_generated_sync/models/sepa_payment.py +easybill_generated_sync/models/sepa_payments.py +easybill_generated_sync/models/serial_number.py +easybill_generated_sync/models/serial_numbers.py +easybill_generated_sync/models/service_date.py +easybill_generated_sync/models/stock.py +easybill_generated_sync/models/stocks.py +easybill_generated_sync/models/task.py +easybill_generated_sync/models/tasks.py +easybill_generated_sync/models/text_template.py +easybill_generated_sync/models/text_templates.py +easybill_generated_sync/models/time_tracking.py +easybill_generated_sync/models/time_trackings.py +easybill_generated_sync/models/web_hook.py +easybill_generated_sync/models/web_hook_last_response.py +easybill_generated_sync/models/web_hooks.py +easybill_generated_sync/py.typed +easybill_generated_sync/rest.py +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_advanced_data_field.py +test/test_attachment.py +test/test_attachment_api.py +test/test_attachments.py +test/test_contact.py +test/test_contact_api.py +test/test_contacts.py +test/test_customer.py +test/test_customer_api.py +test/test_customer_group.py +test/test_customer_group_api.py +test/test_customer_groups.py +test/test_customer_snapshot.py +test/test_customers.py +test/test_discount.py +test/test_discount_api.py +test/test_discount_position.py +test/test_discount_position_group.py +test/test_discount_position_groups.py +test/test_discount_positions.py +test/test_document.py +test/test_document_address.py +test/test_document_api.py +test/test_document_payment.py +test/test_document_payment_api.py +test/test_document_payments.py +test/test_document_position.py +test/test_document_recurring.py +test/test_document_version.py +test/test_document_version_api.py +test/test_document_version_item.py +test/test_document_versions.py +test/test_documents.py +test/test_file_format_config.py +test/test_list.py +test/test_login.py +test/test_login_security.py +test/test_logins.py +test/test_logins_api.py +test/test_pdf_template.py +test/test_pdf_template_settings.py +test/test_pdf_template_settings_email.py +test/test_pdf_templates.py +test/test_pdf_templates_api.py +test/test_position.py +test/test_position_api.py +test/test_position_export_identifier_extended.py +test/test_position_group.py +test/test_position_group_api.py +test/test_position_groups.py +test/test_positions.py +test/test_post_box.py +test/test_post_box_api.py +test/test_post_box_request.py +test/test_post_boxes.py +test/test_project.py +test/test_project_api.py +test/test_projects.py +test/test_sepa_payment.py +test/test_sepa_payment_api.py +test/test_sepa_payments.py +test/test_serial_number.py +test/test_serial_number_api.py +test/test_serial_numbers.py +test/test_service_date.py +test/test_stock.py +test/test_stock_api.py +test/test_stocks.py +test/test_task.py +test/test_task_api.py +test/test_tasks.py +test/test_text_template.py +test/test_text_template_api.py +test/test_text_templates.py +test/test_time_tracking.py +test/test_time_tracking_api.py +test/test_time_trackings.py +test/test_web_hook.py +test/test_web_hook_last_response.py +test/test_web_hooks.py +test/test_webhook_api.py +tox.ini diff --git a/generated/sync/.openapi-generator/VERSION b/generated/sync/.openapi-generator/VERSION new file mode 100644 index 0000000..f7962df --- /dev/null +++ b/generated/sync/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.22.0-SNAPSHOT diff --git a/generated/sync/.travis.yml b/generated/sync/.travis.yml new file mode 100644 index 0000000..dd2e4eb --- /dev/null +++ b/generated/sync/.travis.yml @@ -0,0 +1,17 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.10" + - "3.11" + - "3.12" + - "3.13" + - "3.14" + # uncomment the following if needed + #- "3.14-dev" # 3.14 development branch + #- "nightly" # nightly build +# command to install dependencies +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" +# command to run tests +script: pytest --cov=easybill_generated_sync diff --git a/generated/sync/README.md b/generated/sync/README.md new file mode 100644 index 0000000..1e88081 --- /dev/null +++ b/generated/sync/README.md @@ -0,0 +1,344 @@ +# easybill-generated-sync + +The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) + +## Authentication + +You can choose between two available methods: `Basic Auth` or `Bearer Token`. + +In each HTTP request, one of the following HTTP headers is required: + +``` +# Basic Auth +Authorization: Basic base64_encode(':') +# Bearer Token +Authorization: Bearer +``` + +## Limitations + +### Request Limit + +* PLUS: 10 requests per minute +* BUSINESS: 60 requests per minute + +If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` + +### Result Limit + +All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. + +## Query filter + +Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. + +**Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` + +### Escape commas in query + +You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. + +## Property login_id + +This is the login of your admin or employee account. + +## Date and Date-Time format +Please use the timezone `Europe/Berlin`. +* **date** = *Y-m-d* = `2016-12-31` +* **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` + +Date or datetime can be `null` because the attributes have been added later and the entry is older. + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.96.0 +- Package version: 1.0.0 +- Generator version: 7.22.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.PythonClientCodegen + +## Requirements. + +Python 3.10+ + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import easybill_generated_sync +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import easybill_generated_sync +``` + +### Tests + +Execute `pytest` to run the tests. + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python + +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.AttachmentApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch attachments list + api_response = await api_instance.attachments_get(limit=limit, page=page) + print("The response of AttachmentApi->attachments_get:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling AttachmentApi->attachments_get: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AttachmentApi* | [**attachments_get**](docs/AttachmentApi.md#attachments_get) | **GET** /attachments | Fetch attachments list +*AttachmentApi* | [**attachments_id_content_get**](docs/AttachmentApi.md#attachments_id_content_get) | **GET** /attachments/{id}/content | Fetch attachment content +*AttachmentApi* | [**attachments_id_delete**](docs/AttachmentApi.md#attachments_id_delete) | **DELETE** /attachments/{id} | Delete attachment +*AttachmentApi* | [**attachments_id_get**](docs/AttachmentApi.md#attachments_id_get) | **GET** /attachments/{id} | Fetch attachment +*AttachmentApi* | [**attachments_id_put**](docs/AttachmentApi.md#attachments_id_put) | **PUT** /attachments/{id} | Update attachment +*AttachmentApi* | [**attachments_post**](docs/AttachmentApi.md#attachments_post) | **POST** /attachments | Create attachment +*ContactApi* | [**customers_customer_id_contacts_get**](docs/ContactApi.md#customers_customer_id_contacts_get) | **GET** /customers/{customerId}/contacts | Fetch customer contact list +*ContactApi* | [**customers_customer_id_contacts_id_delete**](docs/ContactApi.md#customers_customer_id_contacts_id_delete) | **DELETE** /customers/{customerId}/contacts/{id} | Delete contact +*ContactApi* | [**customers_customer_id_contacts_id_get**](docs/ContactApi.md#customers_customer_id_contacts_id_get) | **GET** /customers/{customerId}/contacts/{id} | Fetch contact +*ContactApi* | [**customers_customer_id_contacts_id_put**](docs/ContactApi.md#customers_customer_id_contacts_id_put) | **PUT** /customers/{customerId}/contacts/{id} | Update Contact +*ContactApi* | [**customers_customer_id_contacts_post**](docs/ContactApi.md#customers_customer_id_contacts_post) | **POST** /customers/{customerId}/contacts | Create new contact +*CustomerApi* | [**customers_get**](docs/CustomerApi.md#customers_get) | **GET** /customers | Fetch customers list +*CustomerApi* | [**customers_id_delete**](docs/CustomerApi.md#customers_id_delete) | **DELETE** /customers/{id} | Delete customer +*CustomerApi* | [**customers_id_get**](docs/CustomerApi.md#customers_id_get) | **GET** /customers/{id} | Fetch customer +*CustomerApi* | [**customers_id_put**](docs/CustomerApi.md#customers_id_put) | **PUT** /customers/{id} | Update Customer +*CustomerApi* | [**customers_post**](docs/CustomerApi.md#customers_post) | **POST** /customers | Create customer +*CustomerGroupApi* | [**customer_groups_get**](docs/CustomerGroupApi.md#customer_groups_get) | **GET** /customer-groups | Fetch customer group list +*CustomerGroupApi* | [**customer_groups_id_delete**](docs/CustomerGroupApi.md#customer_groups_id_delete) | **DELETE** /customer-groups/{id} | Delete customer group +*CustomerGroupApi* | [**customer_groups_id_get**](docs/CustomerGroupApi.md#customer_groups_id_get) | **GET** /customer-groups/{id} | Fetch customer group +*CustomerGroupApi* | [**customer_groups_id_put**](docs/CustomerGroupApi.md#customer_groups_id_put) | **PUT** /customer-groups/{id} | Update customer group +*CustomerGroupApi* | [**customer_groups_post**](docs/CustomerGroupApi.md#customer_groups_post) | **POST** /customer-groups | Create customer group +*DiscountApi* | [**discounts_position_get**](docs/DiscountApi.md#discounts_position_get) | **GET** /discounts/position | Fetch list of position discounts +*DiscountApi* | [**discounts_position_group_get**](docs/DiscountApi.md#discounts_position_group_get) | **GET** /discounts/position-group | Fetch list of position-group discounts +*DiscountApi* | [**discounts_position_group_id_delete**](docs/DiscountApi.md#discounts_position_group_id_delete) | **DELETE** /discounts/position-group/{id} | Delete the specified position-group discount +*DiscountApi* | [**discounts_position_group_id_get**](docs/DiscountApi.md#discounts_position_group_id_get) | **GET** /discounts/position-group/{id} | Fetch specified position-group discount by id +*DiscountApi* | [**discounts_position_group_id_put**](docs/DiscountApi.md#discounts_position_group_id_put) | **PUT** /discounts/position-group/{id} | Update a position-group discount +*DiscountApi* | [**discounts_position_group_post**](docs/DiscountApi.md#discounts_position_group_post) | **POST** /discounts/position-group | Create a new position-group discount +*DiscountApi* | [**discounts_position_id_delete**](docs/DiscountApi.md#discounts_position_id_delete) | **DELETE** /discounts/position/{id} | Delete the specified position discount +*DiscountApi* | [**discounts_position_id_get**](docs/DiscountApi.md#discounts_position_id_get) | **GET** /discounts/position/{id} | Fetch specified position discount by id +*DiscountApi* | [**discounts_position_id_put**](docs/DiscountApi.md#discounts_position_id_put) | **PUT** /discounts/position/{id} | Update a position discount +*DiscountApi* | [**discounts_position_post**](docs/DiscountApi.md#discounts_position_post) | **POST** /discounts/position | Create a new position discount +*DocumentApi* | [**documents_get**](docs/DocumentApi.md#documents_get) | **GET** /documents | Fetch documents list +*DocumentApi* | [**documents_id_cancel_post**](docs/DocumentApi.md#documents_id_cancel_post) | **POST** /documents/{id}/cancel | Cancel document +*DocumentApi* | [**documents_id_delete**](docs/DocumentApi.md#documents_id_delete) | **DELETE** /documents/{id} | Delete document +*DocumentApi* | [**documents_id_done_put**](docs/DocumentApi.md#documents_id_done_put) | **PUT** /documents/{id}/done | To complete a document. +*DocumentApi* | [**documents_id_download_get**](docs/DocumentApi.md#documents_id_download_get) | **GET** /documents/{id}/download | Fetch the document in best fitting format to the given Accept header +*DocumentApi* | [**documents_id_get**](docs/DocumentApi.md#documents_id_get) | **GET** /documents/{id} | Fetch document +*DocumentApi* | [**documents_id_jpg_get**](docs/DocumentApi.md#documents_id_jpg_get) | **GET** /documents/{id}/jpg | Download a document as an jpeg-image +*DocumentApi* | [**documents_id_pdf_get**](docs/DocumentApi.md#documents_id_pdf_get) | **GET** /documents/{id}/pdf | Fetch pdf document +*DocumentApi* | [**documents_id_put**](docs/DocumentApi.md#documents_id_put) | **PUT** /documents/{id} | Update document +*DocumentApi* | [**documents_id_send_type_post**](docs/DocumentApi.md#documents_id_send_type_post) | **POST** /documents/{id}/send/{type} | Send document +*DocumentApi* | [**documents_id_type_post**](docs/DocumentApi.md#documents_id_type_post) | **POST** /documents/{id}/{type} | Convert an existing document to one of a different type +*DocumentApi* | [**documents_post**](docs/DocumentApi.md#documents_post) | **POST** /documents | Create document +*DocumentPaymentApi* | [**document_payments_get**](docs/DocumentPaymentApi.md#document_payments_get) | **GET** /document-payments | Fetch document payments list +*DocumentPaymentApi* | [**document_payments_id_delete**](docs/DocumentPaymentApi.md#document_payments_id_delete) | **DELETE** /document-payments/{id} | Delete document payment +*DocumentPaymentApi* | [**document_payments_id_get**](docs/DocumentPaymentApi.md#document_payments_id_get) | **GET** /document-payments/{id} | Fetch document payment +*DocumentPaymentApi* | [**document_payments_post**](docs/DocumentPaymentApi.md#document_payments_post) | **POST** /document-payments | Create document payment +*DocumentVersionApi* | [**documents_id_versions_get**](docs/DocumentVersionApi.md#documents_id_versions_get) | **GET** /documents/{id}/versions | List all versions of a given document +*DocumentVersionApi* | [**documents_id_versions_version_id_get**](docs/DocumentVersionApi.md#documents_id_versions_version_id_get) | **GET** /documents/{id}/versions/{versionId} | Show a single version of a given document +*DocumentVersionApi* | [**documents_id_versions_version_id_items_version_item_id_download_get**](docs/DocumentVersionApi.md#documents_id_versions_version_id_items_version_item_id_download_get) | **GET** /documents/{id}/versions/{versionId}/items/{versionItemId}/download | Download a specific file for a single version of a given document +*LoginsApi* | [**logins_get**](docs/LoginsApi.md#logins_get) | **GET** /logins | +*LoginsApi* | [**logins_id_get**](docs/LoginsApi.md#logins_id_get) | **GET** /logins/{id} | +*PdfTemplatesApi* | [**pdf_templates_get**](docs/PdfTemplatesApi.md#pdf_templates_get) | **GET** /pdf-templates | Fetch PDF Templates list +*PositionApi* | [**positions_get**](docs/PositionApi.md#positions_get) | **GET** /positions | Fetch positions list +*PositionApi* | [**positions_id_delete**](docs/PositionApi.md#positions_id_delete) | **DELETE** /positions/{id} | Delete position +*PositionApi* | [**positions_id_get**](docs/PositionApi.md#positions_id_get) | **GET** /positions/{id} | Fetch position +*PositionApi* | [**positions_id_put**](docs/PositionApi.md#positions_id_put) | **PUT** /positions/{id} | Update position +*PositionApi* | [**positions_post**](docs/PositionApi.md#positions_post) | **POST** /positions | Create position +*PositionGroupApi* | [**position_groups_get**](docs/PositionGroupApi.md#position_groups_get) | **GET** /position-groups | Fetch position group list +*PositionGroupApi* | [**position_groups_id_delete**](docs/PositionGroupApi.md#position_groups_id_delete) | **DELETE** /position-groups/{id} | Delete position group +*PositionGroupApi* | [**position_groups_id_get**](docs/PositionGroupApi.md#position_groups_id_get) | **GET** /position-groups/{id} | Fetch position group +*PositionGroupApi* | [**position_groups_id_put**](docs/PositionGroupApi.md#position_groups_id_put) | **PUT** /position-groups/{id} | Update position group +*PositionGroupApi* | [**position_groups_post**](docs/PositionGroupApi.md#position_groups_post) | **POST** /position-groups | Create position group +*PostBoxApi* | [**post_boxes_get**](docs/PostBoxApi.md#post_boxes_get) | **GET** /post-boxes | Fetch post box list +*PostBoxApi* | [**post_boxes_id_delete**](docs/PostBoxApi.md#post_boxes_id_delete) | **DELETE** /post-boxes/{id} | Delete post box +*PostBoxApi* | [**post_boxes_id_get**](docs/PostBoxApi.md#post_boxes_id_get) | **GET** /post-boxes/{id} | Fetch post box +*ProjectApi* | [**projects_get**](docs/ProjectApi.md#projects_get) | **GET** /projects | Fetch projects list +*ProjectApi* | [**projects_id_delete**](docs/ProjectApi.md#projects_id_delete) | **DELETE** /projects/{id} | Delete project +*ProjectApi* | [**projects_id_get**](docs/ProjectApi.md#projects_id_get) | **GET** /projects/{id} | Fetch project +*ProjectApi* | [**projects_id_put**](docs/ProjectApi.md#projects_id_put) | **PUT** /projects/{id} | Update project +*ProjectApi* | [**projects_post**](docs/ProjectApi.md#projects_post) | **POST** /projects | Create project +*SepaPaymentApi* | [**sepa_payments_get**](docs/SepaPaymentApi.md#sepa_payments_get) | **GET** /sepa-payments | Fetch SEPA payments list +*SepaPaymentApi* | [**sepa_payments_id_delete**](docs/SepaPaymentApi.md#sepa_payments_id_delete) | **DELETE** /sepa-payments/{id} | Delete SEPA payment +*SepaPaymentApi* | [**sepa_payments_id_get**](docs/SepaPaymentApi.md#sepa_payments_id_get) | **GET** /sepa-payments/{id} | Fetch SEPA payment +*SepaPaymentApi* | [**sepa_payments_id_put**](docs/SepaPaymentApi.md#sepa_payments_id_put) | **PUT** /sepa-payments/{id} | Update SEPA payment +*SepaPaymentApi* | [**sepa_payments_post**](docs/SepaPaymentApi.md#sepa_payments_post) | **POST** /sepa-payments | Create SEPA payment +*SerialNumberApi* | [**serial_numbers_get**](docs/SerialNumberApi.md#serial_numbers_get) | **GET** /serial-numbers | Fetch a list of serial numbers for positions +*SerialNumberApi* | [**serial_numbers_id_delete**](docs/SerialNumberApi.md#serial_numbers_id_delete) | **DELETE** /serial-numbers/{id} | Delete a serial number for a position +*SerialNumberApi* | [**serial_numbers_id_get**](docs/SerialNumberApi.md#serial_numbers_id_get) | **GET** /serial-numbers/{id} | Fetch a serial number for a position +*SerialNumberApi* | [**serial_numbers_post**](docs/SerialNumberApi.md#serial_numbers_post) | **POST** /serial-numbers | Create s serial number for a position +*StockApi* | [**stocks_get**](docs/StockApi.md#stocks_get) | **GET** /stocks | Fetch a list of stock entries for positions +*StockApi* | [**stocks_id_get**](docs/StockApi.md#stocks_id_get) | **GET** /stocks/{id} | Fetch an stock entry for a position +*StockApi* | [**stocks_post**](docs/StockApi.md#stocks_post) | **POST** /stocks | Create a stock entry for a position +*TaskApi* | [**tasks_get**](docs/TaskApi.md#tasks_get) | **GET** /tasks | Fetch tasks list +*TaskApi* | [**tasks_id_delete**](docs/TaskApi.md#tasks_id_delete) | **DELETE** /tasks/{id} | Delete task +*TaskApi* | [**tasks_id_get**](docs/TaskApi.md#tasks_id_get) | **GET** /tasks/{id} | Fetch task +*TaskApi* | [**tasks_id_put**](docs/TaskApi.md#tasks_id_put) | **PUT** /tasks/{id} | Update task +*TaskApi* | [**tasks_post**](docs/TaskApi.md#tasks_post) | **POST** /tasks | Create task +*TextTemplateApi* | [**text_templates_get**](docs/TextTemplateApi.md#text_templates_get) | **GET** /text-templates | Fetch text templates list +*TextTemplateApi* | [**text_templates_id_delete**](docs/TextTemplateApi.md#text_templates_id_delete) | **DELETE** /text-templates/{id} | Delete text template +*TextTemplateApi* | [**text_templates_id_get**](docs/TextTemplateApi.md#text_templates_id_get) | **GET** /text-templates/{id} | Fetch text template +*TextTemplateApi* | [**text_templates_id_put**](docs/TextTemplateApi.md#text_templates_id_put) | **PUT** /text-templates/{id} | Update text template +*TextTemplateApi* | [**text_templates_post**](docs/TextTemplateApi.md#text_templates_post) | **POST** /text-templates | Create text template +*TimeTrackingApi* | [**time_trackings_get**](docs/TimeTrackingApi.md#time_trackings_get) | **GET** /time-trackings | Fetch time trackings list +*TimeTrackingApi* | [**time_trackings_id_delete**](docs/TimeTrackingApi.md#time_trackings_id_delete) | **DELETE** /time-trackings/{id} | Delete time tracking +*TimeTrackingApi* | [**time_trackings_id_get**](docs/TimeTrackingApi.md#time_trackings_id_get) | **GET** /time-trackings/{id} | Fetch time tracking +*TimeTrackingApi* | [**time_trackings_id_put**](docs/TimeTrackingApi.md#time_trackings_id_put) | **PUT** /time-trackings/{id} | Update time tracking +*TimeTrackingApi* | [**time_trackings_post**](docs/TimeTrackingApi.md#time_trackings_post) | **POST** /time-trackings | Create time tracking +*WebhookApi* | [**webhooks_get**](docs/WebhookApi.md#webhooks_get) | **GET** /webhooks | Fetch WebHooks list +*WebhookApi* | [**webhooks_id_delete**](docs/WebhookApi.md#webhooks_id_delete) | **DELETE** /webhooks/{id} | Delete WebHook +*WebhookApi* | [**webhooks_id_get**](docs/WebhookApi.md#webhooks_id_get) | **GET** /webhooks/{id} | Fetch WebHook +*WebhookApi* | [**webhooks_id_put**](docs/WebhookApi.md#webhooks_id_put) | **PUT** /webhooks/{id} | Update WebHook +*WebhookApi* | [**webhooks_post**](docs/WebhookApi.md#webhooks_post) | **POST** /webhooks | Create WebHook + + +## Documentation For Models + + - [AdvancedDataField](docs/AdvancedDataField.md) + - [Attachment](docs/Attachment.md) + - [Attachments](docs/Attachments.md) + - [Contact](docs/Contact.md) + - [Contacts](docs/Contacts.md) + - [Customer](docs/Customer.md) + - [CustomerGroup](docs/CustomerGroup.md) + - [CustomerGroups](docs/CustomerGroups.md) + - [CustomerSnapshot](docs/CustomerSnapshot.md) + - [Customers](docs/Customers.md) + - [Discount](docs/Discount.md) + - [DiscountPosition](docs/DiscountPosition.md) + - [DiscountPositionGroup](docs/DiscountPositionGroup.md) + - [DiscountPositionGroups](docs/DiscountPositionGroups.md) + - [DiscountPositions](docs/DiscountPositions.md) + - [Document](docs/Document.md) + - [DocumentAddress](docs/DocumentAddress.md) + - [DocumentPayment](docs/DocumentPayment.md) + - [DocumentPayments](docs/DocumentPayments.md) + - [DocumentPosition](docs/DocumentPosition.md) + - [DocumentRecurring](docs/DocumentRecurring.md) + - [DocumentVersion](docs/DocumentVersion.md) + - [DocumentVersionItem](docs/DocumentVersionItem.md) + - [DocumentVersions](docs/DocumentVersions.md) + - [Documents](docs/Documents.md) + - [FileFormatConfig](docs/FileFormatConfig.md) + - [List](docs/List.md) + - [Login](docs/Login.md) + - [LoginSecurity](docs/LoginSecurity.md) + - [Logins](docs/Logins.md) + - [PDFTemplate](docs/PDFTemplate.md) + - [PDFTemplateSettings](docs/PDFTemplateSettings.md) + - [PDFTemplateSettingsEmail](docs/PDFTemplateSettingsEmail.md) + - [PDFTemplates](docs/PDFTemplates.md) + - [Position](docs/Position.md) + - [PositionExportIdentifierExtended](docs/PositionExportIdentifierExtended.md) + - [PositionGroup](docs/PositionGroup.md) + - [PositionGroups](docs/PositionGroups.md) + - [Positions](docs/Positions.md) + - [PostBox](docs/PostBox.md) + - [PostBoxRequest](docs/PostBoxRequest.md) + - [PostBoxes](docs/PostBoxes.md) + - [Project](docs/Project.md) + - [Projects](docs/Projects.md) + - [SEPAPayment](docs/SEPAPayment.md) + - [SEPAPayments](docs/SEPAPayments.md) + - [SerialNumber](docs/SerialNumber.md) + - [SerialNumbers](docs/SerialNumbers.md) + - [ServiceDate](docs/ServiceDate.md) + - [Stock](docs/Stock.md) + - [Stocks](docs/Stocks.md) + - [Task](docs/Task.md) + - [Tasks](docs/Tasks.md) + - [TextTemplate](docs/TextTemplate.md) + - [TextTemplates](docs/TextTemplates.md) + - [TimeTracking](docs/TimeTracking.md) + - [TimeTrackings](docs/TimeTrackings.md) + - [WebHook](docs/WebHook.md) + - [WebHookLastResponse](docs/WebHookLastResponse.md) + - [WebHooks](docs/WebHooks.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### Bearer + +- **Type**: API key +- **API key parameter name**: Authorization +- **Location**: HTTP header + + +### basicAuth + +- **Type**: HTTP basic authentication + + +## Author + + + + diff --git a/generated/sync/docs/AdvancedDataField.md b/generated/sync/docs/AdvancedDataField.md new file mode 100644 index 0000000..bf66be5 --- /dev/null +++ b/generated/sync/docs/AdvancedDataField.md @@ -0,0 +1,31 @@ +# AdvancedDataField + +EN16931 Business Term (BT field) for structured invoice data + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identifier** | **str** | BT field identifier (e.g. 'BT-10' for Buyer reference, 'BT-84' for Payment account identifier) | +**value** | **str** | Field value | + +## Example + +```python +from easybill_generated_sync.models.advanced_data_field import AdvancedDataField + +# TODO update the JSON string below +json = "{}" +# create an instance of AdvancedDataField from a JSON string +advanced_data_field_instance = AdvancedDataField.from_json(json) +# print the JSON string representation of the object +print(AdvancedDataField.to_json()) + +# convert the object into a dict +advanced_data_field_dict = advanced_data_field_instance.to_dict() +# create an instance of AdvancedDataField from a dict +advanced_data_field_from_dict = AdvancedDataField.from_dict(advanced_data_field_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/Attachment.md b/generated/sync/docs/Attachment.md new file mode 100644 index 0000000..0850f23 --- /dev/null +++ b/generated/sync/docs/Attachment.md @@ -0,0 +1,36 @@ +# Attachment + +If customer_id, project_id and document_id are null, the attachment has a global context and is accessible from the web ui. Keep in mind only to provide one of the four context. You can't attach a file to several context in one request. A error is thrown if you provide two or more context (i. E. sending customer_id, document_id and project_id in combination). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **date** | | [optional] [readonly] +**customer_id** | **int** | | [optional] +**document_id** | **int** | | [optional] +**file_name** | **str** | | [optional] [readonly] +**id** | **int** | | [optional] [readonly] +**project_id** | **int** | | [optional] +**size** | **int** | In byte | [optional] [readonly] + +## Example + +```python +from easybill_generated_sync.models.attachment import Attachment + +# TODO update the JSON string below +json = "{}" +# create an instance of Attachment from a JSON string +attachment_instance = Attachment.from_json(json) +# print the JSON string representation of the object +print(Attachment.to_json()) + +# convert the object into a dict +attachment_dict = attachment_instance.to_dict() +# create an instance of Attachment from a dict +attachment_from_dict = Attachment.from_dict(attachment_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/AttachmentApi.md b/generated/sync/docs/AttachmentApi.md new file mode 100644 index 0000000..937050d --- /dev/null +++ b/generated/sync/docs/AttachmentApi.md @@ -0,0 +1,527 @@ +# easybill_generated_sync.AttachmentApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**attachments_get**](AttachmentApi.md#attachments_get) | **GET** /attachments | Fetch attachments list +[**attachments_id_content_get**](AttachmentApi.md#attachments_id_content_get) | **GET** /attachments/{id}/content | Fetch attachment content +[**attachments_id_delete**](AttachmentApi.md#attachments_id_delete) | **DELETE** /attachments/{id} | Delete attachment +[**attachments_id_get**](AttachmentApi.md#attachments_id_get) | **GET** /attachments/{id} | Fetch attachment +[**attachments_id_put**](AttachmentApi.md#attachments_id_put) | **PUT** /attachments/{id} | Update attachment +[**attachments_post**](AttachmentApi.md#attachments_post) | **POST** /attachments | Create attachment + + +# **attachments_get** +> Attachments attachments_get(limit=limit, page=page) + +Fetch attachments list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.attachments import Attachments +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.AttachmentApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch attachments list + api_response = await api_instance.attachments_get(limit=limit, page=page) + print("The response of AttachmentApi->attachments_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AttachmentApi->attachments_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **attachments_id_content_get** +> bytes attachments_id_content_get(id) + +Fetch attachment content + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.AttachmentApi(api_client) + id = 56 # int | ID of attachment + + try: + # Fetch attachment content + api_response = await api_instance.attachments_id_content_get(id) + print("The response of AttachmentApi->attachments_id_content_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AttachmentApi->attachments_id_content_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of attachment | + +### Return type + +**bytes** + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **attachments_id_delete** +> attachments_id_delete(id) + +Delete attachment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.AttachmentApi(api_client) + id = 56 # int | ID of attachment + + try: + # Delete attachment + await api_instance.attachments_id_delete(id) + except Exception as e: + print("Exception when calling AttachmentApi->attachments_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of attachment | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **attachments_id_get** +> Attachment attachments_id_get(id) + +Fetch attachment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.attachment import Attachment +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.AttachmentApi(api_client) + id = 56 # int | ID of attachment + + try: + # Fetch attachment + api_response = await api_instance.attachments_id_get(id) + print("The response of AttachmentApi->attachments_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AttachmentApi->attachments_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of attachment | + +### Return type + +[**Attachment**](Attachment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **attachments_id_put** +> Attachment attachments_id_put(id, body) + +Update attachment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.attachment import Attachment +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.AttachmentApi(api_client) + id = 56 # int | ID of attachment + body = easybill_generated_sync.Attachment() # Attachment | + + try: + # Update attachment + api_response = await api_instance.attachments_id_put(id, body) + print("The response of AttachmentApi->attachments_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AttachmentApi->attachments_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of attachment | + **body** | [**Attachment**](Attachment.md)| | + +### Return type + +[**Attachment**](Attachment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid attachment | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **attachments_post** +> Attachment attachments_post(file) + +Create attachment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.attachment import Attachment +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.AttachmentApi(api_client) + file = None # bytes | + + try: + # Create attachment + api_response = await api_instance.attachments_post(file) + print("The response of AttachmentApi->attachments_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AttachmentApi->attachments_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **bytes**| | + +### Return type + +[**Attachment**](Attachment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/Attachments.md b/generated/sync/docs/Attachments.md new file mode 100644 index 0000000..397628c --- /dev/null +++ b/generated/sync/docs/Attachments.md @@ -0,0 +1,33 @@ +# Attachments + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Attachment]**](Attachment.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.attachments import Attachments + +# TODO update the JSON string below +json = "{}" +# create an instance of Attachments from a JSON string +attachments_instance = Attachments.from_json(json) +# print the JSON string representation of the object +print(Attachments.to_json()) + +# convert the object into a dict +attachments_dict = attachments_instance.to_dict() +# create an instance of Attachments from a dict +attachments_from_dict = Attachments.from_dict(attachments_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/Contact.md b/generated/sync/docs/Contact.md new file mode 100644 index 0000000..9d0b95e --- /dev/null +++ b/generated/sync/docs/Contact.md @@ -0,0 +1,52 @@ +# Contact + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**city** | **str** | | +**state** | **str** | | [optional] +**company_name** | **str** | | [optional] +**country** | **str** | Two-letter country code | [optional] +**department** | **str** | | [optional] [default to 'null'] +**emails** | **List[str]** | | [optional] +**fax** | **str** | | [optional] [default to 'null'] +**first_name** | **str** | | [optional] [default to 'null'] +**id** | **int** | | [optional] [readonly] +**last_name** | **str** | | [optional] [default to 'null'] +**login_id** | **int** | | [optional] [readonly] +**mobile** | **str** | | [optional] [default to 'null'] +**note** | **str** | | [optional] [default to 'null'] +**personal** | **bool** | | [optional] [default to False] +**phone_1** | **str** | | [optional] [default to 'null'] +**phone_2** | **str** | | [optional] [default to 'null'] +**salutation** | **int** | 0: empty<br/> 1: Herrn<br/> 2: Frau<br/> 3: Firma<br/> 4: Herrn und Frau<br/> 5: Eheleute<br/> 6: Familie | [optional] +**street** | **str** | | +**suffix_1** | **str** | | [optional] [default to 'null'] +**suffix_2** | **str** | | [optional] [default to 'null'] +**title** | **str** | | [optional] [default to 'null'] +**zip_code** | **str** | | [optional] [default to 'null'] +**created_at** | **str** | | [optional] [readonly] +**updated_at** | **str** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_sync.models.contact import Contact + +# TODO update the JSON string below +json = "{}" +# create an instance of Contact from a JSON string +contact_instance = Contact.from_json(json) +# print the JSON string representation of the object +print(Contact.to_json()) + +# convert the object into a dict +contact_dict = contact_instance.to_dict() +# create an instance of Contact from a dict +contact_from_dict = Contact.from_dict(contact_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/ContactApi.md b/generated/sync/docs/ContactApi.md new file mode 100644 index 0000000..fb07f86 --- /dev/null +++ b/generated/sync/docs/ContactApi.md @@ -0,0 +1,453 @@ +# easybill_generated_sync.ContactApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**customers_customer_id_contacts_get**](ContactApi.md#customers_customer_id_contacts_get) | **GET** /customers/{customerId}/contacts | Fetch customer contact list +[**customers_customer_id_contacts_id_delete**](ContactApi.md#customers_customer_id_contacts_id_delete) | **DELETE** /customers/{customerId}/contacts/{id} | Delete contact +[**customers_customer_id_contacts_id_get**](ContactApi.md#customers_customer_id_contacts_id_get) | **GET** /customers/{customerId}/contacts/{id} | Fetch contact +[**customers_customer_id_contacts_id_put**](ContactApi.md#customers_customer_id_contacts_id_put) | **PUT** /customers/{customerId}/contacts/{id} | Update Contact +[**customers_customer_id_contacts_post**](ContactApi.md#customers_customer_id_contacts_post) | **POST** /customers/{customerId}/contacts | Create new contact + + +# **customers_customer_id_contacts_get** +> Contacts customers_customer_id_contacts_get(customer_id, limit=limit, page=page) + +Fetch customer contact list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.contacts import Contacts +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.ContactApi(api_client) + customer_id = 56 # int | ID of customer that needs to be fetched + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch customer contact list + api_response = await api_instance.customers_customer_id_contacts_get(customer_id, limit=limit, page=page) + print("The response of ContactApi->customers_customer_id_contacts_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ContactApi->customers_customer_id_contacts_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **customer_id** | **int**| ID of customer that needs to be fetched | + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**Contacts**](Contacts.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_customer_id_contacts_id_delete** +> customers_customer_id_contacts_id_delete(customer_id, id) + +Delete contact + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.ContactApi(api_client) + customer_id = 56 # int | ID of customer + id = 56 # int | ID of contact + + try: + # Delete contact + await api_instance.customers_customer_id_contacts_id_delete(customer_id, id) + except Exception as e: + print("Exception when calling ContactApi->customers_customer_id_contacts_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **customer_id** | **int**| ID of customer | + **id** | **int**| ID of contact | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_customer_id_contacts_id_get** +> Contact customers_customer_id_contacts_id_get(customer_id, id) + +Fetch contact + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.contact import Contact +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.ContactApi(api_client) + customer_id = 56 # int | ID of customer + id = 56 # int | ID of contact + + try: + # Fetch contact + api_response = await api_instance.customers_customer_id_contacts_id_get(customer_id, id) + print("The response of ContactApi->customers_customer_id_contacts_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ContactApi->customers_customer_id_contacts_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **customer_id** | **int**| ID of customer | + **id** | **int**| ID of contact | + +### Return type + +[**Contact**](Contact.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_customer_id_contacts_id_put** +> Contact customers_customer_id_contacts_id_put(customer_id, id, body=body) + +Update Contact + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.contact import Contact +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.ContactApi(api_client) + customer_id = 56 # int | ID of customer + id = 56 # int | ID of contact + body = easybill_generated_sync.Contact() # Contact | (optional) + + try: + # Update Contact + api_response = await api_instance.customers_customer_id_contacts_id_put(customer_id, id, body=body) + print("The response of ContactApi->customers_customer_id_contacts_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ContactApi->customers_customer_id_contacts_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **customer_id** | **int**| ID of customer | + **id** | **int**| ID of contact | + **body** | [**Contact**](Contact.md)| | [optional] + +### Return type + +[**Contact**](Contact.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid contact | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_customer_id_contacts_post** +> Contact customers_customer_id_contacts_post(customer_id, body=body) + +Create new contact + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.contact import Contact +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.ContactApi(api_client) + customer_id = 56 # int | ID of customer + body = easybill_generated_sync.Contact() # Contact | (optional) + + try: + # Create new contact + api_response = await api_instance.customers_customer_id_contacts_post(customer_id, body=body) + print("The response of ContactApi->customers_customer_id_contacts_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ContactApi->customers_customer_id_contacts_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **customer_id** | **int**| ID of customer | + **body** | [**Contact**](Contact.md)| | [optional] + +### Return type + +[**Contact**](Contact.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid contact | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/Contacts.md b/generated/sync/docs/Contacts.md new file mode 100644 index 0000000..67c87d0 --- /dev/null +++ b/generated/sync/docs/Contacts.md @@ -0,0 +1,33 @@ +# Contacts + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Contact]**](Contact.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.contacts import Contacts + +# TODO update the JSON string below +json = "{}" +# create an instance of Contacts from a JSON string +contacts_instance = Contacts.from_json(json) +# print the JSON string representation of the object +print(Contacts.to_json()) + +# convert the object into a dict +contacts_dict = contacts_instance.to_dict() +# create an instance of Contacts from a dict +contacts_from_dict = Contacts.from_dict(contacts_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/Customer.md b/generated/sync/docs/Customer.md new file mode 100644 index 0000000..80a8a5c --- /dev/null +++ b/generated/sync/docs/Customer.md @@ -0,0 +1,106 @@ +# Customer + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**acquire_options** | **int** | 1 = Empfehlung eines anderen Kunden, 2 = Zeitungsanzeige, 3 = Eigene Akquisition, 4 = Mitarbeiter Akquisition, 5 = Google, 6 = Gelbe Seiten, 7 = Kostenlose Internet Plattform, 8 = Bezahlte Internet Plattform | [optional] +**additional_groups_ids** | **List[int]** | | [optional] +**bank_account** | **str** | | [optional] +**bank_account_owner** | **str** | | [optional] +**bank_bic** | **str** | | [optional] +**bank_code** | **str** | | [optional] +**bank_iban** | **str** | | [optional] +**bank_name** | **str** | | [optional] +**birth_date** | **date** | | [optional] +**cash_allowance** | **float** | | [optional] +**cash_allowance_days** | **int** | | [optional] +**cash_discount** | **float** | | [optional] +**cash_discount_type** | **str** | | [optional] +**city** | **str** | | [optional] +**state** | **str** | | [optional] +**company_name** | **str** | | +**country** | **str** | | [optional] +**created_at** | **date** | | [optional] [readonly] +**updated_at** | **str** | | [optional] [readonly] +**delivery_title** | **str** | | [optional] +**delivery_city** | **str** | | [optional] +**delivery_state** | **str** | | [optional] +**delivery_company_name** | **str** | | [optional] +**delivery_country** | **str** | | [optional] +**delivery_first_name** | **str** | | [optional] +**delivery_last_name** | **str** | | [optional] +**delivery_personal** | **bool** | | [optional] +**delivery_salutation** | **int** | 0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family | [optional] +**delivery_street** | **str** | | [optional] +**delivery_suffix_1** | **str** | | [optional] +**delivery_suffix_2** | **str** | | [optional] +**delivery_zip_code** | **str** | | [optional] +**display_name** | **str** | | [optional] [readonly] +**emails** | **List[str]** | | [optional] +**fax** | **str** | | [optional] +**first_name** | **str** | | [optional] +**grace_period** | **int** | will be replaced by its alias due_in_days. | [optional] +**due_in_days** | **int** | due date in days | [optional] +**group_id** | **int** | | [optional] +**id** | **int** | | [optional] [readonly] +**info_1** | **str** | | [optional] +**info_2** | **str** | | [optional] +**internet** | **str** | | [optional] +**last_name** | **str** | | +**login_id** | **int** | | [optional] +**mobile** | **str** | | [optional] +**note** | **str** | | [optional] +**number** | **str** | Automatically generated if empty/omitted and when no type in query is provided or the type 'CUSTOMER', 'CUSTOMER,SUPPLIER' | [optional] +**supplier_number** | **str** | Automatically generated if the type SUPPLIER or 'CUSTOMER,SUPPLIER' is provided as query parameter and the field supplier_number is empty/omitted. | [optional] +**payment_options** | **int** | 1 = Stets pünktliche Zahlung, 2 = überwiegend pünktliche Zahlung, 3 = überwiegend verspätete Zahlung, 5 = Grundsätzlich verspätete Zahlung | [optional] +**personal** | **bool** | | [optional] [default to False] +**phone_1** | **str** | | [optional] +**phone_2** | **str** | | [optional] +**postbox** | **str** | | [optional] +**postbox_city** | **str** | | [optional] +**postbox_state** | **str** | | [optional] +**postbox_country** | **str** | | [optional] +**postbox_zip_code** | **str** | | [optional] +**sale_price_level** | **str** | | [optional] +**salutation** | **int** | 0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family | [optional] +**sepa_agreement** | **str** | BASIC = SEPA-Basislastschrift, COR1 = SEPA-Basislastschrift COR1 (deprecated use BASIC instead), COMPANY = SEPA-Firmenlastschrift, NULL = Noch kein Mandat erteilt | [optional] +**sepa_agreement_date** | **date** | | [optional] +**sepa_mandate_reference** | **str** | | [optional] +**since_date** | **date** | | [optional] +**street** | **str** | | [optional] +**suffix_1** | **str** | | [optional] +**suffix_2** | **str** | | [optional] +**tax_number** | **str** | | [optional] +**court** | **str** | | [optional] +**court_registry_number** | **str** | | [optional] +**tax_options** | **str** | nStb = Nicht steuerbar (Drittland), nStbUstID = Nicht steuerbar (EU mit USt-IdNr.), nStbNoneUstID = Nicht steuerbar (EU ohne USt-IdNr.), revc = Steuerschuldwechsel §13b (Inland), IG = Innergemeinschaftliche Lieferung, AL = Ausfuhrlieferung, sStfr = sonstige Steuerbefreiung, NULL = Umsatzsteuerpflichtig | [optional] +**title** | **str** | | [optional] +**archived** | **bool** | | [optional] +**vat_identifier** | **str** | | [optional] +**zip_code** | **str** | | [optional] +**document_pdf_type** | **str** | Type of PDF to use when sending a Document to the Customer. | [optional] [default to 'default'] +**buyer_reference** | **str** | Used as \"buyerReference\" in ZUGFeRD and as \"Leitweg-ID\" in the XRechnung format. | [optional] +**foreign_supplier_number** | **str** | The ID given to your company by the customer in his system. | [optional] + +## Example + +```python +from easybill_generated_sync.models.customer import Customer + +# TODO update the JSON string below +json = "{}" +# create an instance of Customer from a JSON string +customer_instance = Customer.from_json(json) +# print the JSON string representation of the object +print(Customer.to_json()) + +# convert the object into a dict +customer_dict = customer_instance.to_dict() +# create an instance of Customer from a dict +customer_from_dict = Customer.from_dict(customer_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/CustomerApi.md b/generated/sync/docs/CustomerApi.md new file mode 100644 index 0000000..95f4562 --- /dev/null +++ b/generated/sync/docs/CustomerApi.md @@ -0,0 +1,467 @@ +# easybill_generated_sync.CustomerApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**customers_get**](CustomerApi.md#customers_get) | **GET** /customers | Fetch customers list +[**customers_id_delete**](CustomerApi.md#customers_id_delete) | **DELETE** /customers/{id} | Delete customer +[**customers_id_get**](CustomerApi.md#customers_id_get) | **GET** /customers/{id} | Fetch customer +[**customers_id_put**](CustomerApi.md#customers_id_put) | **PUT** /customers/{id} | Update Customer +[**customers_post**](CustomerApi.md#customers_post) | **POST** /customers | Create customer + + +# **customers_get** +> Customers customers_get(limit=limit, page=page, group_id=group_id, additional_group_id=additional_group_id, number=number, country=country, zip_code=zip_code, emails=emails, first_name=first_name, last_name=last_name, company_name=company_name, created_at=created_at) + +Fetch customers list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.customers import Customers +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.CustomerApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + group_id = 'group_id_example' # str | Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id. (optional) + additional_group_id = 'additional_group_id_example' # str | Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id. (optional) + number = 'number_example' # str | Filter customers by number. You can add multiple numbers separate by comma like no,no,no. (optional) + country = 'country_example' # str | Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR. (optional) + zip_code = 'zip_code_example' # str | Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip. (optional) + emails = 'emails_example' # str | Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail. (optional) + first_name = 'first_name_example' # str | Filter customers by first_name. You can add multiple names separate by comma like name,name,name. (optional) + last_name = 'last_name_example' # str | Filter customers by first_name. You can add multiple names separate by comma like name,name,name. (optional) + company_name = 'company_name_example' # str | Filter customers by first_name. You can add multiple names separate by comma like name,name,name. (optional) + created_at = 'created_at_example' # str | Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31. (optional) + + try: + # Fetch customers list + api_response = await api_instance.customers_get(limit=limit, page=page, group_id=group_id, additional_group_id=additional_group_id, number=number, country=country, zip_code=zip_code, emails=emails, first_name=first_name, last_name=last_name, company_name=company_name, created_at=created_at) + print("The response of CustomerApi->customers_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerApi->customers_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **group_id** | **str**| Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id. | [optional] + **additional_group_id** | **str**| Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id. | [optional] + **number** | **str**| Filter customers by number. You can add multiple numbers separate by comma like no,no,no. | [optional] + **country** | **str**| Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR. | [optional] + **zip_code** | **str**| Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip. | [optional] + **emails** | **str**| Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail. | [optional] + **first_name** | **str**| Filter customers by first_name. You can add multiple names separate by comma like name,name,name. | [optional] + **last_name** | **str**| Filter customers by first_name. You can add multiple names separate by comma like name,name,name. | [optional] + **company_name** | **str**| Filter customers by first_name. You can add multiple names separate by comma like name,name,name. | [optional] + **created_at** | **str**| Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31. | [optional] + +### Return type + +[**Customers**](Customers.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_id_delete** +> customers_id_delete(id) + +Delete customer + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.CustomerApi(api_client) + id = 56 # int | ID of customer that needs to be deleted + + try: + # Delete customer + await api_instance.customers_id_delete(id) + except Exception as e: + print("Exception when calling CustomerApi->customers_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of customer that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_id_get** +> Customer customers_id_get(id) + +Fetch customer + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.customer import Customer +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.CustomerApi(api_client) + id = 56 # int | ID of customer that needs to be fetched + + try: + # Fetch customer + api_response = await api_instance.customers_id_get(id) + print("The response of CustomerApi->customers_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerApi->customers_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of customer that needs to be fetched | + +### Return type + +[**Customer**](Customer.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_id_put** +> Customer customers_id_put(id, body, type=type) + +Update Customer + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.customer import Customer +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.CustomerApi(api_client) + id = 56 # int | ID of customer that needs to be updated + body = easybill_generated_sync.Customer() # Customer | + type = CUSTOMER # str | Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". (optional) (default to CUSTOMER) + + try: + # Update Customer + api_response = await api_instance.customers_id_put(id, body, type=type) + print("The response of CustomerApi->customers_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerApi->customers_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of customer that needs to be updated | + **body** | [**Customer**](Customer.md)| | + **type** | **str**| Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". | [optional] [default to CUSTOMER] + +### Return type + +[**Customer**](Customer.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid Customer | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customers_post** +> Customer customers_post(body, type=type) + +Create customer + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.customer import Customer +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.CustomerApi(api_client) + body = easybill_generated_sync.Customer() # Customer | + type = CUSTOMER # str | Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". (optional) (default to CUSTOMER) + + try: + # Create customer + api_response = await api_instance.customers_post(body, type=type) + print("The response of CustomerApi->customers_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerApi->customers_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Customer**](Customer.md)| | + **type** | **str**| Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". | [optional] [default to CUSTOMER] + +### Return type + +[**Customer**](Customer.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**400** | Invalid Customer | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/CustomerGroup.md b/generated/sync/docs/CustomerGroup.md new file mode 100644 index 0000000..659744c --- /dev/null +++ b/generated/sync/docs/CustomerGroup.md @@ -0,0 +1,33 @@ +# CustomerGroup + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**description** | **str** | | [optional] [default to 'null'] +**number** | **str** | Can be chosen freely | +**display_name** | **str** | | [optional] [readonly] +**id** | **int** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_sync.models.customer_group import CustomerGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of CustomerGroup from a JSON string +customer_group_instance = CustomerGroup.from_json(json) +# print the JSON string representation of the object +print(CustomerGroup.to_json()) + +# convert the object into a dict +customer_group_dict = customer_group_instance.to_dict() +# create an instance of CustomerGroup from a dict +customer_group_from_dict = CustomerGroup.from_dict(customer_group_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/CustomerGroupApi.md b/generated/sync/docs/CustomerGroupApi.md new file mode 100644 index 0000000..8492a72 --- /dev/null +++ b/generated/sync/docs/CustomerGroupApi.md @@ -0,0 +1,442 @@ +# easybill_generated_sync.CustomerGroupApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**customer_groups_get**](CustomerGroupApi.md#customer_groups_get) | **GET** /customer-groups | Fetch customer group list +[**customer_groups_id_delete**](CustomerGroupApi.md#customer_groups_id_delete) | **DELETE** /customer-groups/{id} | Delete customer group +[**customer_groups_id_get**](CustomerGroupApi.md#customer_groups_id_get) | **GET** /customer-groups/{id} | Fetch customer group +[**customer_groups_id_put**](CustomerGroupApi.md#customer_groups_id_put) | **PUT** /customer-groups/{id} | Update customer group +[**customer_groups_post**](CustomerGroupApi.md#customer_groups_post) | **POST** /customer-groups | Create customer group + + +# **customer_groups_get** +> CustomerGroups customer_groups_get(limit=limit, page=page) + +Fetch customer group list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.customer_groups import CustomerGroups +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.CustomerGroupApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch customer group list + api_response = await api_instance.customer_groups_get(limit=limit, page=page) + print("The response of CustomerGroupApi->customer_groups_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerGroupApi->customer_groups_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**CustomerGroups**](CustomerGroups.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customer_groups_id_delete** +> customer_groups_id_delete(id) + +Delete customer group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.CustomerGroupApi(api_client) + id = 56 # int | ID of customer group + + try: + # Delete customer group + await api_instance.customer_groups_id_delete(id) + except Exception as e: + print("Exception when calling CustomerGroupApi->customer_groups_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of customer group | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customer_groups_id_get** +> CustomerGroup customer_groups_id_get(id) + +Fetch customer group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.customer_group import CustomerGroup +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.CustomerGroupApi(api_client) + id = 56 # int | ID of customer group + + try: + # Fetch customer group + api_response = await api_instance.customer_groups_id_get(id) + print("The response of CustomerGroupApi->customer_groups_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerGroupApi->customer_groups_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of customer group | + +### Return type + +[**CustomerGroup**](CustomerGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customer_groups_id_put** +> CustomerGroup customer_groups_id_put(id, body) + +Update customer group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.customer_group import CustomerGroup +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.CustomerGroupApi(api_client) + id = 56 # int | ID of customer goup + body = easybill_generated_sync.CustomerGroup() # CustomerGroup | + + try: + # Update customer group + api_response = await api_instance.customer_groups_id_put(id, body) + print("The response of CustomerGroupApi->customer_groups_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerGroupApi->customer_groups_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of customer goup | + **body** | [**CustomerGroup**](CustomerGroup.md)| | + +### Return type + +[**CustomerGroup**](CustomerGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid customer group | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **customer_groups_post** +> CustomerGroup customer_groups_post(body) + +Create customer group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.customer_group import CustomerGroup +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.CustomerGroupApi(api_client) + body = easybill_generated_sync.CustomerGroup() # CustomerGroup | + + try: + # Create customer group + api_response = await api_instance.customer_groups_post(body) + print("The response of CustomerGroupApi->customer_groups_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CustomerGroupApi->customer_groups_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CustomerGroup**](CustomerGroup.md)| | + +### Return type + +[**CustomerGroup**](CustomerGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/CustomerGroups.md b/generated/sync/docs/CustomerGroups.md new file mode 100644 index 0000000..6a9ec16 --- /dev/null +++ b/generated/sync/docs/CustomerGroups.md @@ -0,0 +1,33 @@ +# CustomerGroups + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[CustomerGroup]**](CustomerGroup.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.customer_groups import CustomerGroups + +# TODO update the JSON string below +json = "{}" +# create an instance of CustomerGroups from a JSON string +customer_groups_instance = CustomerGroups.from_json(json) +# print the JSON string representation of the object +print(CustomerGroups.to_json()) + +# convert the object into a dict +customer_groups_dict = customer_groups_instance.to_dict() +# create an instance of CustomerGroups from a dict +customer_groups_from_dict = CustomerGroups.from_dict(customer_groups_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/CustomerSnapshot.md b/generated/sync/docs/CustomerSnapshot.md new file mode 100644 index 0000000..7f9247f --- /dev/null +++ b/generated/sync/docs/CustomerSnapshot.md @@ -0,0 +1,107 @@ +# CustomerSnapshot + +A snapshot of the customer model which belongs to a document. This model is readonly and the state is final after finalization of the document. It's is identical to the state of the customer model at the time of finalization. Updates to the actual customer dataset won't affect this snapshot, however if you update the document the customer and therefore the customer snapshot may reflect a different state. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**acquire_options** | **int** | 1 = Empfehlung eines anderen Kunden, 2 = Zeitungsanzeige, 3 = Eigene Akquisition, 4 = Mitarbeiter Akquisition, 5 = Google, 6 = Gelbe Seiten, 7 = Kostenlose Internet Plattform, 8 = Bezahlte Internet Plattform | [optional] +**additional_groups_ids** | **List[int]** | | [optional] +**bank_account** | **str** | | [optional] +**bank_account_owner** | **str** | | [optional] +**bank_bic** | **str** | | [optional] +**bank_code** | **str** | | [optional] +**bank_iban** | **str** | | [optional] +**bank_name** | **str** | | [optional] +**birth_date** | **date** | | [optional] +**cash_allowance** | **float** | | [optional] +**cash_allowance_days** | **int** | | [optional] +**cash_discount** | **float** | | [optional] +**cash_discount_type** | **str** | | [optional] +**city** | **str** | | [optional] +**state** | **str** | | [optional] +**company_name** | **str** | | +**country** | **str** | | [optional] +**created_at** | **date** | | [optional] [readonly] +**updated_at** | **str** | | [optional] [readonly] +**delivery_title** | **str** | | [optional] +**delivery_city** | **str** | | [optional] +**delivery_state** | **str** | | [optional] +**delivery_company_name** | **str** | | [optional] +**delivery_country** | **str** | | [optional] +**delivery_first_name** | **str** | | [optional] +**delivery_last_name** | **str** | | [optional] +**delivery_personal** | **bool** | | [optional] +**delivery_salutation** | **int** | 0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family | [optional] +**delivery_street** | **str** | | [optional] +**delivery_suffix_1** | **str** | | [optional] +**delivery_suffix_2** | **str** | | [optional] +**delivery_zip_code** | **str** | | [optional] +**display_name** | **str** | | [optional] [readonly] +**emails** | **List[str]** | | [optional] +**fax** | **str** | | [optional] +**first_name** | **str** | | [optional] +**grace_period** | **int** | will be replaced by its alias due_in_days. | [optional] +**due_in_days** | **int** | due date in days | [optional] +**group_id** | **int** | | [optional] +**id** | **int** | | [optional] [readonly] +**info_1** | **str** | | [optional] +**info_2** | **str** | | [optional] +**internet** | **str** | | [optional] +**last_name** | **str** | | +**login_id** | **int** | | [optional] +**mobile** | **str** | | [optional] +**note** | **str** | | [optional] +**number** | **str** | Automatically generated if empty/omitted and when no type in query is provided or the type 'CUSTOMER', 'CUSTOMER,SUPPLIER' | [optional] +**supplier_number** | **str** | Automatically generated if the type SUPPLIER or 'CUSTOMER,SUPPLIER' is provided as query parameter and the field supplier_number is empty/omitted. | [optional] +**payment_options** | **int** | 1 = Stets pünktliche Zahlung, 2 = überwiegend pünktliche Zahlung, 3 = überwiegend verspätete Zahlung, 5 = Grundsätzlich verspätete Zahlung | [optional] +**personal** | **bool** | | [optional] [default to False] +**phone_1** | **str** | | [optional] +**phone_2** | **str** | | [optional] +**postbox** | **str** | | [optional] +**postbox_city** | **str** | | [optional] +**postbox_state** | **str** | | [optional] +**postbox_country** | **str** | | [optional] +**postbox_zip_code** | **str** | | [optional] +**sale_price_level** | **str** | | [optional] +**salutation** | **int** | 0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family | [optional] +**sepa_agreement** | **str** | BASIC = SEPA-Basislastschrift, COR1 = SEPA-Basislastschrift COR1 (deprecated use BASIC instead), COMPANY = SEPA-Firmenlastschrift, NULL = Noch kein Mandat erteilt | [optional] +**sepa_agreement_date** | **date** | | [optional] +**sepa_mandate_reference** | **str** | | [optional] +**since_date** | **date** | | [optional] +**street** | **str** | | [optional] +**suffix_1** | **str** | | [optional] +**suffix_2** | **str** | | [optional] +**tax_number** | **str** | | [optional] +**court** | **str** | | [optional] +**court_registry_number** | **str** | | [optional] +**tax_options** | **str** | nStb = Nicht steuerbar (Drittland), nStbUstID = Nicht steuerbar (EU mit USt-IdNr.), nStbNoneUstID = Nicht steuerbar (EU ohne USt-IdNr.), revc = Steuerschuldwechsel §13b (Inland), IG = Innergemeinschaftliche Lieferung, AL = Ausfuhrlieferung, sStfr = sonstige Steuerbefreiung, NULL = Umsatzsteuerpflichtig | [optional] +**title** | **str** | | [optional] +**archived** | **bool** | | [optional] +**vat_identifier** | **str** | | [optional] +**zip_code** | **str** | | [optional] +**document_pdf_type** | **str** | Type of PDF to use when sending a Document to the Customer. | [optional] [default to 'default'] +**buyer_reference** | **str** | Used as \"buyerReference\" in ZUGFeRD and as \"Leitweg-ID\" in the XRechnung format. | [optional] +**foreign_supplier_number** | **str** | The ID given to your company by the customer in his system. | [optional] + +## Example + +```python +from easybill_generated_sync.models.customer_snapshot import CustomerSnapshot + +# TODO update the JSON string below +json = "{}" +# create an instance of CustomerSnapshot from a JSON string +customer_snapshot_instance = CustomerSnapshot.from_json(json) +# print the JSON string representation of the object +print(CustomerSnapshot.to_json()) + +# convert the object into a dict +customer_snapshot_dict = customer_snapshot_instance.to_dict() +# create an instance of CustomerSnapshot from a dict +customer_snapshot_from_dict = CustomerSnapshot.from_dict(customer_snapshot_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/Customers.md b/generated/sync/docs/Customers.md new file mode 100644 index 0000000..cfb1d07 --- /dev/null +++ b/generated/sync/docs/Customers.md @@ -0,0 +1,33 @@ +# Customers + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Customer]**](Customer.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.customers import Customers + +# TODO update the JSON string below +json = "{}" +# create an instance of Customers from a JSON string +customers_instance = Customers.from_json(json) +# print the JSON string representation of the object +print(Customers.to_json()) + +# convert the object into a dict +customers_dict = customers_instance.to_dict() +# create an instance of Customers from a dict +customers_from_dict = Customers.from_dict(customers_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/Discount.md b/generated/sync/docs/Discount.md new file mode 100644 index 0000000..100baaa --- /dev/null +++ b/generated/sync/docs/Discount.md @@ -0,0 +1,32 @@ +# Discount + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**customer_id** | **int** | | +**discount** | **int** | The discount value depending on \"discount_type\". If not provided, inherits from customer when available | [optional] +**discount_type** | **str** | AMOUNT subtracts the value in \"discount\" from the total<br/> QUANTITY subtracts the value in \"discount\" multiplied by quantity<br/> PERCENT uses the value in \"discount\" as a percentage<br/> FIX sets the value in \"discount\" as the new price. If not provided, inherits from customer when available | [optional] [default to 'PERCENT'] + +## Example + +```python +from easybill_generated_sync.models.discount import Discount + +# TODO update the JSON string below +json = "{}" +# create an instance of Discount from a JSON string +discount_instance = Discount.from_json(json) +# print the JSON string representation of the object +print(Discount.to_json()) + +# convert the object into a dict +discount_dict = discount_instance.to_dict() +# create an instance of Discount from a dict +discount_from_dict = Discount.from_dict(discount_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/DiscountApi.md b/generated/sync/docs/DiscountApi.md new file mode 100644 index 0000000..b3884f9 --- /dev/null +++ b/generated/sync/docs/DiscountApi.md @@ -0,0 +1,888 @@ +# easybill_generated_sync.DiscountApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**discounts_position_get**](DiscountApi.md#discounts_position_get) | **GET** /discounts/position | Fetch list of position discounts +[**discounts_position_group_get**](DiscountApi.md#discounts_position_group_get) | **GET** /discounts/position-group | Fetch list of position-group discounts +[**discounts_position_group_id_delete**](DiscountApi.md#discounts_position_group_id_delete) | **DELETE** /discounts/position-group/{id} | Delete the specified position-group discount +[**discounts_position_group_id_get**](DiscountApi.md#discounts_position_group_id_get) | **GET** /discounts/position-group/{id} | Fetch specified position-group discount by id +[**discounts_position_group_id_put**](DiscountApi.md#discounts_position_group_id_put) | **PUT** /discounts/position-group/{id} | Update a position-group discount +[**discounts_position_group_post**](DiscountApi.md#discounts_position_group_post) | **POST** /discounts/position-group | Create a new position-group discount +[**discounts_position_id_delete**](DiscountApi.md#discounts_position_id_delete) | **DELETE** /discounts/position/{id} | Delete the specified position discount +[**discounts_position_id_get**](DiscountApi.md#discounts_position_id_get) | **GET** /discounts/position/{id} | Fetch specified position discount by id +[**discounts_position_id_put**](DiscountApi.md#discounts_position_id_put) | **PUT** /discounts/position/{id} | Update a position discount +[**discounts_position_post**](DiscountApi.md#discounts_position_post) | **POST** /discounts/position | Create a new position discount + + +# **discounts_position_get** +> DiscountPositions discounts_position_get(limit=limit, page=page, customer_id=customer_id) + +Fetch list of position discounts + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.discount_positions import DiscountPositions +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DiscountApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + customer_id = 'customer_id_example' # str | Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. (optional) + + try: + # Fetch list of position discounts + api_response = await api_instance.discounts_position_get(limit=limit, page=page, customer_id=customer_id) + print("The response of DiscountApi->discounts_position_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **customer_id** | **str**| Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. | [optional] + +### Return type + +[**DiscountPositions**](DiscountPositions.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_group_get** +> DiscountPositionGroups discounts_position_group_get(limit=limit, page=page, customer_id=customer_id) + +Fetch list of position-group discounts + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.discount_position_groups import DiscountPositionGroups +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DiscountApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + customer_id = 'customer_id_example' # str | Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. (optional) + + try: + # Fetch list of position-group discounts + api_response = await api_instance.discounts_position_group_get(limit=limit, page=page, customer_id=customer_id) + print("The response of DiscountApi->discounts_position_group_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_group_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **customer_id** | **str**| Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. | [optional] + +### Return type + +[**DiscountPositionGroups**](DiscountPositionGroups.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_group_id_delete** +> discounts_position_group_id_delete(id) + +Delete the specified position-group discount + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DiscountApi(api_client) + id = 56 # int | ID of the to be soon deleted discount + + try: + # Delete the specified position-group discount + await api_instance.discounts_position_group_id_delete(id) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_group_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the to be soon deleted discount | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_group_id_get** +> DiscountPositionGroup discounts_position_group_id_get(id, limit=limit, page=page) + +Fetch specified position-group discount by id + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.discount_position_group import DiscountPositionGroup +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DiscountApi(api_client) + id = 56 # int | ID of the discount + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch specified position-group discount by id + api_response = await api_instance.discounts_position_group_id_get(id, limit=limit, page=page) + print("The response of DiscountApi->discounts_position_group_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_group_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the discount | + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**DiscountPositionGroup**](DiscountPositionGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_group_id_put** +> DiscountPositionGroup discounts_position_group_id_put(id, body=body) + +Update a position-group discount + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.discount_position_group import DiscountPositionGroup +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DiscountApi(api_client) + id = 56 # int | ID of the to be soon updated discount + body = easybill_generated_sync.DiscountPositionGroup() # DiscountPositionGroup | (optional) + + try: + # Update a position-group discount + api_response = await api_instance.discounts_position_group_id_put(id, body=body) + print("The response of DiscountApi->discounts_position_group_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_group_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the to be soon updated discount | + **body** | [**DiscountPositionGroup**](DiscountPositionGroup.md)| | [optional] + +### Return type + +[**DiscountPositionGroup**](DiscountPositionGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_group_post** +> DiscountPositionGroup discounts_position_group_post(body) + +Create a new position-group discount + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.discount_position_group import DiscountPositionGroup +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DiscountApi(api_client) + body = easybill_generated_sync.DiscountPositionGroup() # DiscountPositionGroup | + + try: + # Create a new position-group discount + api_response = await api_instance.discounts_position_group_post(body) + print("The response of DiscountApi->discounts_position_group_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_group_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**DiscountPositionGroup**](DiscountPositionGroup.md)| | + +### Return type + +[**DiscountPositionGroup**](DiscountPositionGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_id_delete** +> discounts_position_id_delete(id) + +Delete the specified position discount + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DiscountApi(api_client) + id = 56 # int | ID of the to be soon deleted discount + + try: + # Delete the specified position discount + await api_instance.discounts_position_id_delete(id) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the to be soon deleted discount | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_id_get** +> DiscountPosition discounts_position_id_get(id, limit=limit, page=page) + +Fetch specified position discount by id + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.discount_position import DiscountPosition +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DiscountApi(api_client) + id = 56 # int | ID of the discount + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch specified position discount by id + api_response = await api_instance.discounts_position_id_get(id, limit=limit, page=page) + print("The response of DiscountApi->discounts_position_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the discount | + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**DiscountPosition**](DiscountPosition.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_id_put** +> DiscountPosition discounts_position_id_put(id, body=body) + +Update a position discount + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.discount_position import DiscountPosition +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DiscountApi(api_client) + id = 56 # int | ID of the to be soon updated discount + body = easybill_generated_sync.DiscountPosition() # DiscountPosition | (optional) + + try: + # Update a position discount + api_response = await api_instance.discounts_position_id_put(id, body=body) + print("The response of DiscountApi->discounts_position_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the to be soon updated discount | + **body** | [**DiscountPosition**](DiscountPosition.md)| | [optional] + +### Return type + +[**DiscountPosition**](DiscountPosition.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **discounts_position_post** +> DiscountPosition discounts_position_post(body) + +Create a new position discount + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.discount_position import DiscountPosition +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DiscountApi(api_client) + body = easybill_generated_sync.DiscountPosition() # DiscountPosition | + + try: + # Create a new position discount + api_response = await api_instance.discounts_position_post(body) + print("The response of DiscountApi->discounts_position_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscountApi->discounts_position_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**DiscountPosition**](DiscountPosition.md)| | + +### Return type + +[**DiscountPosition**](DiscountPosition.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/DiscountPosition.md b/generated/sync/docs/DiscountPosition.md new file mode 100644 index 0000000..b391847 --- /dev/null +++ b/generated/sync/docs/DiscountPosition.md @@ -0,0 +1,33 @@ +# DiscountPosition + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**customer_id** | **int** | | +**discount** | **int** | The discount value depending on \"discount_type\". If not provided, inherits from customer when available | [optional] +**discount_type** | **str** | AMOUNT subtracts the value in \"discount\" from the total<br/> QUANTITY subtracts the value in \"discount\" multiplied by quantity<br/> PERCENT uses the value in \"discount\" as a percentage<br/> FIX sets the value in \"discount\" as the new price. If not provided, inherits from customer when available | [optional] [default to 'PERCENT'] +**position_id** | **int** | | + +## Example + +```python +from easybill_generated_sync.models.discount_position import DiscountPosition + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscountPosition from a JSON string +discount_position_instance = DiscountPosition.from_json(json) +# print the JSON string representation of the object +print(DiscountPosition.to_json()) + +# convert the object into a dict +discount_position_dict = discount_position_instance.to_dict() +# create an instance of DiscountPosition from a dict +discount_position_from_dict = DiscountPosition.from_dict(discount_position_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/DiscountPositionGroup.md b/generated/sync/docs/DiscountPositionGroup.md new file mode 100644 index 0000000..b334402 --- /dev/null +++ b/generated/sync/docs/DiscountPositionGroup.md @@ -0,0 +1,33 @@ +# DiscountPositionGroup + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**customer_id** | **int** | | +**discount** | **int** | The discount value depending on \"discount_type\". If not provided, inherits from customer when available | [optional] +**discount_type** | **str** | AMOUNT subtracts the value in \"discount\" from the total<br/> QUANTITY subtracts the value in \"discount\" multiplied by quantity<br/> PERCENT uses the value in \"discount\" as a percentage<br/> FIX sets the value in \"discount\" as the new price. If not provided, inherits from customer when available | [optional] [default to 'PERCENT'] +**position_group_id** | **int** | | + +## Example + +```python +from easybill_generated_sync.models.discount_position_group import DiscountPositionGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscountPositionGroup from a JSON string +discount_position_group_instance = DiscountPositionGroup.from_json(json) +# print the JSON string representation of the object +print(DiscountPositionGroup.to_json()) + +# convert the object into a dict +discount_position_group_dict = discount_position_group_instance.to_dict() +# create an instance of DiscountPositionGroup from a dict +discount_position_group_from_dict = DiscountPositionGroup.from_dict(discount_position_group_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/DiscountPositionGroups.md b/generated/sync/docs/DiscountPositionGroups.md new file mode 100644 index 0000000..5778cf3 --- /dev/null +++ b/generated/sync/docs/DiscountPositionGroups.md @@ -0,0 +1,33 @@ +# DiscountPositionGroups + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[DiscountPositionGroup]**](DiscountPositionGroup.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.discount_position_groups import DiscountPositionGroups + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscountPositionGroups from a JSON string +discount_position_groups_instance = DiscountPositionGroups.from_json(json) +# print the JSON string representation of the object +print(DiscountPositionGroups.to_json()) + +# convert the object into a dict +discount_position_groups_dict = discount_position_groups_instance.to_dict() +# create an instance of DiscountPositionGroups from a dict +discount_position_groups_from_dict = DiscountPositionGroups.from_dict(discount_position_groups_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/DiscountPositions.md b/generated/sync/docs/DiscountPositions.md new file mode 100644 index 0000000..52d015c --- /dev/null +++ b/generated/sync/docs/DiscountPositions.md @@ -0,0 +1,33 @@ +# DiscountPositions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[DiscountPosition]**](DiscountPosition.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.discount_positions import DiscountPositions + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscountPositions from a JSON string +discount_positions_instance = DiscountPositions.from_json(json) +# print the JSON string representation of the object +print(DiscountPositions.to_json()) + +# convert the object into a dict +discount_positions_dict = discount_positions_instance.to_dict() +# create an instance of DiscountPositions from a dict +discount_positions_from_dict = DiscountPositions.from_dict(discount_positions_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/Document.md b/generated/sync/docs/Document.md new file mode 100644 index 0000000..e1b6db3 --- /dev/null +++ b/generated/sync/docs/Document.md @@ -0,0 +1,97 @@ +# Document + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**DocumentAddress**](DocumentAddress.md) | | [optional] +**advanced_data_fields** | [**List[AdvancedDataField]**](AdvancedDataField.md) | EN16931 Business Terms (BT fields) for structured invoice data. On update the submitted list fully replaces the existing fields — send an empty array to clear all. | [optional] +**attachment_ids** | **List[int]** | | [optional] [readonly] +**label_address** | [**DocumentAddress**](DocumentAddress.md) | | [optional] +**amount** | **int** | Amount in cents (e.g. \"150\" = 1.50€) | [optional] [readonly] +**amount_net** | **int** | Amount in cents (e.g. \"150\" = 1.50€) | [optional] [readonly] +**anonymize_due_date** | **date** | A date which signals when to anonymize the document. Must be in the future. Turns into a read only field if the document is anonymized | [optional] +**anonymize_status** | **str** | This field signals if the document was anonymized | [optional] [readonly] [default to 'NOT_ANONYMIZED'] +**anonymized_at** | **str** | | [optional] [readonly] +**bank_debit_form** | **str** | | [optional] [default to 'null'] +**billing_country** | **str** | | [optional] [readonly] +**calc_vat_from** | **int** | 0 === Net, 1 === Gross. | [optional] +**cancel_id** | **int** | ID from the cancel document. Only for document type INVOICE. | [optional] [readonly] +**cash_allowance** | **float** | Cash allowance percentage. If not provided, inherits from customer when available. | [optional] +**cash_allowance_days** | **int** | Days for cash allowance. If not provided, inherits from customer when available. | [optional] +**cash_allowance_text** | **str** | | [optional] [default to 'null'] +**contact_id** | **int** | | [optional] +**contact_label** | **str** | | [optional] [default to ''] +**contact_text** | **str** | | [optional] [default to ''] +**created_at** | **datetime** | | [optional] [readonly] +**currency** | **str** | | [optional] [default to 'EUR'] +**customer_id** | **int** | | [optional] +**customer_snapshot** | [**CustomerSnapshot**](CustomerSnapshot.md) | | [optional] +**discount** | **str** | | [optional] [default to 'null'] +**discount_type** | **str** | | [optional] [default to null] +**document_date** | **date** | | [optional] +**due_date** | **date** | To change the value use grace_period. | [optional] [readonly] +**edited_at** | **datetime** | | [optional] [readonly] +**external_id** | **str** | | [optional] [default to 'null'] +**replica_url** | **str** | | [optional] [default to 'null'] +**grace_period** | **int** | will be replaced by its alias due_in_days. | [optional] +**due_in_days** | **int** | due date in days. If not provided, inherits from customer when available | [optional] +**id** | **int** | | [optional] [readonly] +**is_acceptable_on_public_domain** | **bool** | Indicates if a document can be accepted by the end customer through the document's public access page. | [optional] [default to False] +**is_archive** | **bool** | | [optional] [default to False] +**is_draft** | **bool** | This property is read only. To finish the document call /documents/{id}/done. | [optional] [readonly] +**is_replica** | **bool** | Marks a document as a replica from another software. | [optional] [default to False] +**is_oss** | **bool** | Indicates if a document is a one-stop-shop document | [optional] [default to False] +**item_notes** | **List[str]** | Field holds all unique document_note of items for the document | [optional] [readonly] +**items** | [**List[DocumentPosition]**](DocumentPosition.md) | | [optional] +**last_postbox_id** | **int** | | [optional] [readonly] +**login_id** | **int** | If omitted or null, the currently active login is used. | [optional] +**number** | **str** | | [optional] [default to 'null'] +**order_number** | **str** | | [optional] [default to ''] +**buyer_reference** | **str** | | [optional] [default to ''] +**paid_amount** | **int** | | [optional] [readonly] +**paid_at** | **date** | | [optional] [readonly] +**pdf_pages** | **int** | | [optional] [readonly] +**pdf_template** | **str** | Default template is null or 'DE', default english is 'EN' and for all others use the numeric template ID. | [optional] +**payment_link_enabled** | **bool** | Whether the payment link is shown on this document. Overrides the setting from the referenced template. | [optional] [default to False] +**payment_link_locale** | **str** | Language of the payment link text on the document. | [optional] [default to 'de'] +**project_id** | **int** | | [optional] +**recurring_options** | [**DocumentRecurring**](DocumentRecurring.md) | | [optional] +**ref_id** | **int** | Reference document id | [optional] +**root_id** | **int** | Root document id | [optional] [readonly] +**service_date** | [**ServiceDate**](ServiceDate.md) | | [optional] +**shipping_country** | **str** | | [optional] [default to 'null'] +**status** | **str** | This value can only be used in document type DELIVERY, ORDER, CHARGE or OFFER. NULL is default = not set. | [optional] [default to null] +**text** | **str** | | [optional] +**text_prefix** | **str** | | [optional] +**text_tax** | **str** | Overwrites the default vat-option text from the document layout. It is only displayed in documents with the type other than: Delivery, Dunning, Reminder or Letter and a different vat-option than null | [optional] [default to 'null'] +**title** | **str** | | [optional] [default to 'null'] +**type** | **str** | Can only set on create. | [optional] [default to 'INVOICE'] +**use_shipping_address** | **bool** | If true and customer has shipping address then it will be used. | [optional] [default to False] +**vat_country** | **str** | | [optional] [default to 'null'] +**vat_id** | **str** | | [optional] [readonly] [default to ''] +**fulfillment_country** | **str** | | [optional] [default to 'null'] +**vat_option** | **str** | NULL: Normal steuerbar<br/> nStb: Nicht steuerbar (Drittland)<br/> nStbUstID: Nicht steuerbar (EU mit USt-IdNr.)<br/> nStbNoneUstID: Nicht steuerbar (EU ohne USt-IdNr.)<br/> nStbIm: Nicht steuerbarer Innenumsatz<br/> revc: Steuerschuldwechsel §13b (Inland)<br/> IG: Innergemeinschaftliche Lieferung<br/> AL: Ausfuhrlieferung<br/> sStfr: sonstige Steuerbefreiung<br/> smallBusiness: Kleinunternehmen (Keine MwSt.) | [optional] [default to null] +**file_format_config** | [**List[FileFormatConfig]**](FileFormatConfig.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.document import Document + +# TODO update the JSON string below +json = "{}" +# create an instance of Document from a JSON string +document_instance = Document.from_json(json) +# print the JSON string representation of the object +print(Document.to_json()) + +# convert the object into a dict +document_dict = document_instance.to_dict() +# create an instance of Document from a dict +document_from_dict = Document.from_dict(document_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/DocumentAddress.md b/generated/sync/docs/DocumentAddress.md new file mode 100644 index 0000000..cb2d592 --- /dev/null +++ b/generated/sync/docs/DocumentAddress.md @@ -0,0 +1,42 @@ +# DocumentAddress + +This information comes from the customer which can be set with customer_id. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**salutation** | **int** | 0: empty<br/> 1: Herrn<br/> 2: Frau<br/> 3: Firma<br/> 4: Herrn und Frau<br/> 5: Eheleute<br/> 6: Familie | [optional] [readonly] +**personal** | **bool** | | [optional] [readonly] +**title** | **str** | | [optional] [readonly] +**first_name** | **str** | | [optional] [readonly] +**last_name** | **str** | | [optional] [readonly] +**suffix_1** | **str** | | [optional] [readonly] +**suffix_2** | **str** | | [optional] [readonly] +**company_name** | **str** | | [optional] [readonly] +**street** | **str** | | [optional] [readonly] +**zip_code** | **str** | | [optional] [readonly] +**city** | **str** | | [optional] [readonly] +**state** | **str** | | [optional] [readonly] +**country** | **str** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_sync.models.document_address import DocumentAddress + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentAddress from a JSON string +document_address_instance = DocumentAddress.from_json(json) +# print the JSON string representation of the object +print(DocumentAddress.to_json()) + +# convert the object into a dict +document_address_dict = document_address_instance.to_dict() +# create an instance of DocumentAddress from a dict +document_address_from_dict = DocumentAddress.from_dict(document_address_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/DocumentApi.md b/generated/sync/docs/DocumentApi.md new file mode 100644 index 0000000..e24f9ef --- /dev/null +++ b/generated/sync/docs/DocumentApi.md @@ -0,0 +1,1104 @@ +# easybill_generated_sync.DocumentApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**documents_get**](DocumentApi.md#documents_get) | **GET** /documents | Fetch documents list +[**documents_id_cancel_post**](DocumentApi.md#documents_id_cancel_post) | **POST** /documents/{id}/cancel | Cancel document +[**documents_id_delete**](DocumentApi.md#documents_id_delete) | **DELETE** /documents/{id} | Delete document +[**documents_id_done_put**](DocumentApi.md#documents_id_done_put) | **PUT** /documents/{id}/done | To complete a document. +[**documents_id_download_get**](DocumentApi.md#documents_id_download_get) | **GET** /documents/{id}/download | Fetch the document in best fitting format to the given Accept header +[**documents_id_get**](DocumentApi.md#documents_id_get) | **GET** /documents/{id} | Fetch document +[**documents_id_jpg_get**](DocumentApi.md#documents_id_jpg_get) | **GET** /documents/{id}/jpg | Download a document as an jpeg-image +[**documents_id_pdf_get**](DocumentApi.md#documents_id_pdf_get) | **GET** /documents/{id}/pdf | Fetch pdf document +[**documents_id_put**](DocumentApi.md#documents_id_put) | **PUT** /documents/{id} | Update document +[**documents_id_send_type_post**](DocumentApi.md#documents_id_send_type_post) | **POST** /documents/{id}/send/{type} | Send document +[**documents_id_type_post**](DocumentApi.md#documents_id_type_post) | **POST** /documents/{id}/{type} | Convert an existing document to one of a different type +[**documents_post**](DocumentApi.md#documents_post) | **POST** /documents | Create document + + +# **documents_get** +> Documents documents_get(limit=limit, page=page, type=type, is_draft=is_draft, is_archive=is_archive, customer_id=customer_id, project_id=project_id, ref_id=ref_id, document_date=document_date, paid_at=paid_at, title=title, number=number, cancel_id=cancel_id, fulfillment_country=fulfillment_country, vat_country=vat_country, shipping_country=shipping_country, status=status, edited_at=edited_at) + +Fetch documents list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.documents import Documents +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + type = 'type_example' # str | Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT. (optional) + is_draft = 'is_draft_example' # str | Filter documents by draft flag. (optional) + is_archive = 'is_archive_example' # str | Filter documents by archive flag. (optional) + customer_id = 'customer_id_example' # str | Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id. (optional) + project_id = 'project_id_example' # str | Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id. (optional) + ref_id = 'ref_id_example' # str | Filter documents by ref_id. (optional) + document_date = 'document_date_example' # str | Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31. (optional) + paid_at = 'paid_at_example' # str | Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents. (optional) + title = 'title_example' # str | Filter documents by title. (optional) + number = 'number_example' # str | Filter documents by number. (optional) + cancel_id = 'cancel_id_example' # str | Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents. (optional) + fulfillment_country = 'fulfillment_country_example' # str | Filter documents by fulfillment_country. (optional) + vat_country = 'vat_country_example' # str | Filter documents by vat_country. (optional) + shipping_country = 'shipping_country_example' # str | Filter documents by shipping_country. (optional) + status = 'status_example' # str | Filter documents by status. Keep in mind that not every document type has a status. (optional) + edited_at = 'edited_at_example' # str | Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31. (optional) + + try: + # Fetch documents list + api_response = await api_instance.documents_get(limit=limit, page=page, type=type, is_draft=is_draft, is_archive=is_archive, customer_id=customer_id, project_id=project_id, ref_id=ref_id, document_date=document_date, paid_at=paid_at, title=title, number=number, cancel_id=cancel_id, fulfillment_country=fulfillment_country, vat_country=vat_country, shipping_country=shipping_country, status=status, edited_at=edited_at) + print("The response of DocumentApi->documents_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **type** | **str**| Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT. | [optional] + **is_draft** | **str**| Filter documents by draft flag. | [optional] + **is_archive** | **str**| Filter documents by archive flag. | [optional] + **customer_id** | **str**| Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id. | [optional] + **project_id** | **str**| Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id. | [optional] + **ref_id** | **str**| Filter documents by ref_id. | [optional] + **document_date** | **str**| Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31. | [optional] + **paid_at** | **str**| Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents. | [optional] + **title** | **str**| Filter documents by title. | [optional] + **number** | **str**| Filter documents by number. | [optional] + **cancel_id** | **str**| Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents. | [optional] + **fulfillment_country** | **str**| Filter documents by fulfillment_country. | [optional] + **vat_country** | **str**| Filter documents by vat_country. | [optional] + **shipping_country** | **str**| Filter documents by shipping_country. | [optional] + **status** | **str**| Filter documents by status. Keep in mind that not every document type has a status. | [optional] + **edited_at** | **str**| Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31. | [optional] + +### Return type + +[**Documents**](Documents.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_cancel_post** +> Document documents_id_cancel_post(id, use_text_from_template=use_text_from_template) + +Cancel document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.document import Document +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentApi(api_client) + id = 56 # int | ID of document + use_text_from_template = False # bool | Use standard texts from the template. (optional) (default to False) + + try: + # Cancel document + api_response = await api_instance.documents_id_cancel_post(id, use_text_from_template=use_text_from_template) + print("The response of DocumentApi->documents_id_cancel_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_cancel_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **use_text_from_template** | **bool**| Use standard texts from the template. | [optional] [default to False] + +### Return type + +[**Document**](Document.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_delete** +> documents_id_delete(id) + +Delete document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentApi(api_client) + id = 56 # int | ID of document + + try: + # Delete document + await api_instance.documents_id_delete(id) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**409** | Resource is locked. This status is returned if a process is currently running which locks the requested resource. Try again later. | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_done_put** +> Document documents_id_done_put(id, reason_for_change=reason_for_change) + +To complete a document. + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.document import Document +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentApi(api_client) + id = 56 # int | ID of document + reason_for_change = 'reason_for_change_example' # str | A string that is saved on the document version as reason. (optional) + + try: + # To complete a document. + api_response = await api_instance.documents_id_done_put(id, reason_for_change=reason_for_change) + print("The response of DocumentApi->documents_id_done_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_done_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **reason_for_change** | **str**| A string that is saved on the document version as reason. | [optional] + +### Return type + +[**Document**](Document.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**409** | Resource is locked. This status is returned if a process is currently running which locks the requested resource. Try again later. | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_download_get** +> bytes documents_id_download_get(id, accept=accept) + +Fetch the document in best fitting format to the given Accept header + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentApi(api_client) + id = 56 # int | ID of document + accept = 'accept_example' # str | The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher. (optional) + + try: + # Fetch the document in best fitting format to the given Accept header + api_response = await api_instance.documents_id_download_get(id, accept=accept) + print("The response of DocumentApi->documents_id_download_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_download_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **accept** | **str**| The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher. | [optional] + +### Return type + +**bytes** + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/pdf, application/pdf;format=zugferd;version=1.0.0, application/pdf;format=zugferd;version=2.2.0, application/xml;format=xrechnung;version=2.3.0, application/xml;format=xrechnung;version=3.0.1 + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation, a binary matching the defined expectations via 'Accept' header could be found and will be returned. The 'Content-Type' header of the response will contain the exact pdf format provided. | - | +**404** | Not found | - | +**406** | No matching format of the document is available | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_get** +> Document documents_id_get(id) + +Fetch document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.document import Document +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentApi(api_client) + id = 56 # int | ID of document + + try: + # Fetch document + api_response = await api_instance.documents_id_get(id) + print("The response of DocumentApi->documents_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + +### Return type + +[**Document**](Document.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_jpg_get** +> bytes documents_id_jpg_get(id, offset=offset, limit=limit) + +Download a document as an jpeg-image + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentApi(api_client) + id = 56 # int | ID of document + offset = 56 # int | The page of the document where the image should start. (optional) + limit = 56 # int | The page of the document where the image should end. (optional) + + try: + # Download a document as an jpeg-image + api_response = await api_instance.documents_id_jpg_get(id, offset=offset, limit=limit) + print("The response of DocumentApi->documents_id_jpg_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_jpg_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **offset** | **int**| The page of the document where the image should start. | [optional] + **limit** | **int**| The page of the document where the image should end. | [optional] + +### Return type + +**bytes** + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: image/jpeg + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_pdf_get** +> bytes documents_id_pdf_get(id) + +Fetch pdf document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentApi(api_client) + id = 56 # int | ID of document + + try: + # Fetch pdf document + api_response = await api_instance.documents_id_pdf_get(id) + print("The response of DocumentApi->documents_id_pdf_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_pdf_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + +### Return type + +**bytes** + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/pdf + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_put** +> Document documents_id_put(id, body, refresh_customer_data=refresh_customer_data, reason_for_change=reason_for_change) + +Update document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.document import Document +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentApi(api_client) + id = 56 # int | ID of document + body = easybill_generated_sync.Document() # Document | + refresh_customer_data = True # bool | Forces refreshing of the customer data. (optional) + reason_for_change = 'reason_for_change_example' # str | A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value. (optional) + + try: + # Update document + api_response = await api_instance.documents_id_put(id, body, refresh_customer_data=refresh_customer_data, reason_for_change=reason_for_change) + print("The response of DocumentApi->documents_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **body** | [**Document**](Document.md)| | + **refresh_customer_data** | **bool**| Forces refreshing of the customer data. | [optional] + **reason_for_change** | **str**| A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value. | [optional] + +### Return type + +[**Document**](Document.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid Document | - | +**409** | Resource is locked. This status is returned if a process is currently running which locks the requested resource. Try again later. | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_send_type_post** +> documents_id_send_type_post(id, type, body) + +Send document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.post_box_request import PostBoxRequest +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentApi(api_client) + id = 56 # int | ID of document + type = 'type_example' # str | + body = easybill_generated_sync.PostBoxRequest() # PostBoxRequest | + + try: + # Send document + await api_instance.documents_id_send_type_post(id, type, body) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_send_type_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **type** | **str**| | + **body** | [**PostBoxRequest**](PostBoxRequest.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_type_post** +> Document documents_id_type_post(id, type, pdf_template=pdf_template) + +Convert an existing document to one of a different type + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.document import Document +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentApi(api_client) + id = 56 # int | ID of document + type = 'type_example' # str | The target document type + pdf_template = 'DE' # str | The ID of the printer template to use. Defaults to 'DE' if not given. (optional) (default to 'DE') + + try: + # Convert an existing document to one of a different type + api_response = await api_instance.documents_id_type_post(id, type, pdf_template=pdf_template) + print("The response of DocumentApi->documents_id_type_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_id_type_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **type** | **str**| The target document type | + **pdf_template** | **str**| The ID of the printer template to use. Defaults to 'DE' if not given. | [optional] [default to 'DE'] + +### Return type + +[**Document**](Document.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | * Location - Absolute URL to the newly created document
| +**400** | Invalid target document type | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_post** +> Document documents_post(body) + +Create document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.document import Document +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentApi(api_client) + body = easybill_generated_sync.Document() # Document | + + try: + # Create document + api_response = await api_instance.documents_post(body) + print("The response of DocumentApi->documents_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentApi->documents_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Document**](Document.md)| | + +### Return type + +[**Document**](Document.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/DocumentPayment.md b/generated/sync/docs/DocumentPayment.md new file mode 100644 index 0000000..2958982 --- /dev/null +++ b/generated/sync/docs/DocumentPayment.md @@ -0,0 +1,38 @@ +# DocumentPayment + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **int** | | +**document_id** | **int** | | +**id** | **int** | | [optional] [readonly] +**is_overdue_fee** | **bool** | | [optional] +**login_id** | **int** | | [optional] [readonly] +**notice** | **str** | | [optional] [default to ''] +**payment_at** | **date** | | [optional] +**type** | **str** | | [optional] [default to ''] +**provider** | **str** | | [optional] [default to ''] +**reference** | **str** | | [optional] [default to ''] + +## Example + +```python +from easybill_generated_sync.models.document_payment import DocumentPayment + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentPayment from a JSON string +document_payment_instance = DocumentPayment.from_json(json) +# print the JSON string representation of the object +print(DocumentPayment.to_json()) + +# convert the object into a dict +document_payment_dict = document_payment_instance.to_dict() +# create an instance of DocumentPayment from a dict +document_payment_from_dict = DocumentPayment.from_dict(document_payment_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/DocumentPaymentApi.md b/generated/sync/docs/DocumentPaymentApi.md new file mode 100644 index 0000000..5dd2db9 --- /dev/null +++ b/generated/sync/docs/DocumentPaymentApi.md @@ -0,0 +1,361 @@ +# easybill_generated_sync.DocumentPaymentApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**document_payments_get**](DocumentPaymentApi.md#document_payments_get) | **GET** /document-payments | Fetch document payments list +[**document_payments_id_delete**](DocumentPaymentApi.md#document_payments_id_delete) | **DELETE** /document-payments/{id} | Delete document payment +[**document_payments_id_get**](DocumentPaymentApi.md#document_payments_id_get) | **GET** /document-payments/{id} | Fetch document payment +[**document_payments_post**](DocumentPaymentApi.md#document_payments_post) | **POST** /document-payments | Create document payment + + +# **document_payments_get** +> DocumentPayments document_payments_get(limit=limit, page=page, document_id=document_id, payment_at=payment_at, reference=reference) + +Fetch document payments list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.document_payments import DocumentPayments +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentPaymentApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + document_id = 'document_id_example' # str | Filter payments by document_id. You can add multiple ids separate by comma like id,id,id. (optional) + payment_at = 'payment_at_example' # str | Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31. (optional) + reference = 'reference_example' # str | Filter payments by reference. You can add multiple references separate by comma like id,id,id. (optional) + + try: + # Fetch document payments list + api_response = await api_instance.document_payments_get(limit=limit, page=page, document_id=document_id, payment_at=payment_at, reference=reference) + print("The response of DocumentPaymentApi->document_payments_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentPaymentApi->document_payments_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **document_id** | **str**| Filter payments by document_id. You can add multiple ids separate by comma like id,id,id. | [optional] + **payment_at** | **str**| Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31. | [optional] + **reference** | **str**| Filter payments by reference. You can add multiple references separate by comma like id,id,id. | [optional] + +### Return type + +[**DocumentPayments**](DocumentPayments.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **document_payments_id_delete** +> document_payments_id_delete(id) + +Delete document payment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentPaymentApi(api_client) + id = 56 # int | ID of document payment + + try: + # Delete document payment + await api_instance.document_payments_id_delete(id) + except Exception as e: + print("Exception when calling DocumentPaymentApi->document_payments_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document payment | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **document_payments_id_get** +> DocumentPayment document_payments_id_get(id) + +Fetch document payment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.document_payment import DocumentPayment +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentPaymentApi(api_client) + id = 56 # int | ID of document payment + + try: + # Fetch document payment + api_response = await api_instance.document_payments_id_get(id) + print("The response of DocumentPaymentApi->document_payments_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentPaymentApi->document_payments_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document payment | + +### Return type + +[**DocumentPayment**](DocumentPayment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **document_payments_post** +> DocumentPayment document_payments_post(body, paid=paid) + +Create document payment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.document_payment import DocumentPayment +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentPaymentApi(api_client) + body = easybill_generated_sync.DocumentPayment() # DocumentPayment | + paid = True # bool | Mark document as paid when amount less then payment amount. (optional) + + try: + # Create document payment + api_response = await api_instance.document_payments_post(body, paid=paid) + print("The response of DocumentPaymentApi->document_payments_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentPaymentApi->document_payments_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**DocumentPayment**](DocumentPayment.md)| | + **paid** | **bool**| Mark document as paid when amount less then payment amount. | [optional] + +### Return type + +[**DocumentPayment**](DocumentPayment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/DocumentPayments.md b/generated/sync/docs/DocumentPayments.md new file mode 100644 index 0000000..0985ec4 --- /dev/null +++ b/generated/sync/docs/DocumentPayments.md @@ -0,0 +1,33 @@ +# DocumentPayments + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[DocumentPayment]**](DocumentPayment.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.document_payments import DocumentPayments + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentPayments from a JSON string +document_payments_instance = DocumentPayments.from_json(json) +# print the JSON string representation of the object +print(DocumentPayments.to_json()) + +# convert the object into a dict +document_payments_dict = document_payments_instance.to_dict() +# create an instance of DocumentPayments from a dict +document_payments_from_dict = DocumentPayments.from_dict(document_payments_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/DocumentPosition.md b/generated/sync/docs/DocumentPosition.md new file mode 100644 index 0000000..9219719 --- /dev/null +++ b/generated/sync/docs/DocumentPosition.md @@ -0,0 +1,56 @@ +# DocumentPosition + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **str** | | [optional] [default to 'null'] +**description** | **str** | | [optional] [default to 'null'] +**document_note** | **str** | This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction. | [optional] +**quantity** | **float** | | [optional] [default to 1.0] +**quantity_str** | **str** | Use quantity_str if you want to set a quantity like: 1:30 h or 3x5 m. quantity_str overwrites quantity. | [optional] +**unit** | **str** | | [optional] [default to 'null'] +**type** | **str** | | [optional] [default to 'POSITION'] +**position** | **int** | Automatic by default (first item: 1, second item: 2, ...) | [optional] +**single_price_net** | **float** | Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€) | [optional] +**single_price_gross** | **float** | Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€) | [optional] +**vat_percent** | **float** | | [optional] [default to 0.0] +**discount** | **float** | | [optional] +**discount_type** | **str** | | [optional] [default to null] +**position_id** | **int** | If set, values are copied from the referenced position | [optional] +**total_price_net** | **float** | Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€) | [optional] [readonly] +**total_price_gross** | **float** | Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€) | [optional] [readonly] +**total_vat** | **float** | | [optional] [readonly] +**serial_number_id** | **str** | | [optional] [readonly] +**serial_number** | **str** | | [optional] [readonly] +**booking_account** | **str** | | [optional] [default to 'null'] +**export_cost_1** | **str** | | [optional] [default to 'null'] +**export_cost_2** | **str** | | [optional] [default to 'null'] +**cost_price_net** | **float** | Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€) | [optional] +**cost_price_total** | **float** | Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€) | [optional] [readonly] +**cost_price_charge** | **float** | | [optional] [readonly] +**cost_price_charge_type** | **str** | | [optional] [readonly] +**item_type** | **str** | | [optional] [default to 'UNDEFINED'] +**id** | **int** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_sync.models.document_position import DocumentPosition + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentPosition from a JSON string +document_position_instance = DocumentPosition.from_json(json) +# print the JSON string representation of the object +print(DocumentPosition.to_json()) + +# convert the object into a dict +document_position_dict = document_position_instance.to_dict() +# create an instance of DocumentPosition from a dict +document_position_from_dict = DocumentPosition.from_dict(document_position_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/DocumentRecurring.md b/generated/sync/docs/DocumentRecurring.md new file mode 100644 index 0000000..f9ccfa3 --- /dev/null +++ b/generated/sync/docs/DocumentRecurring.md @@ -0,0 +1,47 @@ +# DocumentRecurring + +This object is only available in document type RECURRING. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_date** | **date** | Must be in the future | +**frequency** | **str** | | [optional] [default to 'MONTHLY'] +**frequency_special** | **str** | | [optional] [default to null] +**interval** | **int** | | [optional] +**end_date_or_count** | **str** | Date of last exectution day or number of times to exectute | [optional] [default to 'null'] +**status** | **str** | | [optional] [default to 'WAITING'] +**as_draft** | **bool** | | [optional] [default to False] +**is_notify** | **bool** | | [optional] [default to False] +**send_as** | **str** | | [optional] [default to null] +**is_sign** | **bool** | | [optional] [default to False] +**is_paid** | **bool** | | [optional] [default to False] +**paid_date_option** | **str** | Option is used to determine what date is used for the payment if is_paid is true. \"next_valid_date\" selects the next workday in regards to the created date of the document if the date falls on a saturday or sunday. | [optional] [default to 'created_date'] +**is_sepa** | **bool** | | [optional] [default to False] +**sepa_local_instrument** | **str** | COR1 is deprecated use CORE instead. | [optional] [default to null] +**sepa_sequence_type** | **str** | | [optional] [default to null] +**sepa_reference** | **str** | | [optional] [default to 'null'] +**sepa_remittance_information** | **str** | | [optional] [default to 'null'] +**target_type** | **str** | The document type that will be generated. Can not be changed on existing documents. | [optional] [default to 'INVOICE'] + +## Example + +```python +from easybill_generated_sync.models.document_recurring import DocumentRecurring + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentRecurring from a JSON string +document_recurring_instance = DocumentRecurring.from_json(json) +# print the JSON string representation of the object +print(DocumentRecurring.to_json()) + +# convert the object into a dict +document_recurring_dict = document_recurring_instance.to_dict() +# create an instance of DocumentRecurring from a dict +document_recurring_from_dict = DocumentRecurring.from_dict(document_recurring_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/DocumentVersion.md b/generated/sync/docs/DocumentVersion.md new file mode 100644 index 0000000..6851176 --- /dev/null +++ b/generated/sync/docs/DocumentVersion.md @@ -0,0 +1,33 @@ +# DocumentVersion + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | **datetime** | | [optional] [readonly] +**document_id** | **int** | | [optional] [readonly] +**id** | **int** | | [optional] [readonly] +**items** | [**List[DocumentVersionItem]**](DocumentVersionItem.md) | | [optional] +**reason** | **str** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_sync.models.document_version import DocumentVersion + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentVersion from a JSON string +document_version_instance = DocumentVersion.from_json(json) +# print the JSON string representation of the object +print(DocumentVersion.to_json()) + +# convert the object into a dict +document_version_dict = document_version_instance.to_dict() +# create an instance of DocumentVersion from a dict +document_version_from_dict = DocumentVersion.from_dict(document_version_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/DocumentVersionApi.md b/generated/sync/docs/DocumentVersionApi.md new file mode 100644 index 0000000..4d6be5e --- /dev/null +++ b/generated/sync/docs/DocumentVersionApi.md @@ -0,0 +1,277 @@ +# easybill_generated_sync.DocumentVersionApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**documents_id_versions_get**](DocumentVersionApi.md#documents_id_versions_get) | **GET** /documents/{id}/versions | List all versions of a given document +[**documents_id_versions_version_id_get**](DocumentVersionApi.md#documents_id_versions_version_id_get) | **GET** /documents/{id}/versions/{versionId} | Show a single version of a given document +[**documents_id_versions_version_id_items_version_item_id_download_get**](DocumentVersionApi.md#documents_id_versions_version_id_items_version_item_id_download_get) | **GET** /documents/{id}/versions/{versionId}/items/{versionItemId}/download | Download a specific file for a single version of a given document + + +# **documents_id_versions_get** +> DocumentVersions documents_id_versions_get(id, limit=limit, page=page) + +List all versions of a given document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.document_versions import DocumentVersions +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentVersionApi(api_client) + id = 56 # int | ID of document + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # List all versions of a given document + api_response = await api_instance.documents_id_versions_get(id, limit=limit, page=page) + print("The response of DocumentVersionApi->documents_id_versions_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentVersionApi->documents_id_versions_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**DocumentVersions**](DocumentVersions.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_versions_version_id_get** +> DocumentVersion documents_id_versions_version_id_get(id, version_id) + +Show a single version of a given document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.document_version import DocumentVersion +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentVersionApi(api_client) + id = 56 # int | ID of document + version_id = 56 # int | ID of document version + + try: + # Show a single version of a given document + api_response = await api_instance.documents_id_versions_version_id_get(id, version_id) + print("The response of DocumentVersionApi->documents_id_versions_version_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentVersionApi->documents_id_versions_version_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **version_id** | **int**| ID of document version | + +### Return type + +[**DocumentVersion**](DocumentVersion.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Document Version does not exist | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **documents_id_versions_version_id_items_version_item_id_download_get** +> bytes documents_id_versions_version_id_items_version_item_id_download_get(id, version_id, version_item_id) + +Download a specific file for a single version of a given document + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.DocumentVersionApi(api_client) + id = 56 # int | ID of document + version_id = 56 # int | ID of document version + version_item_id = 56 # int | ID of document version item + + try: + # Download a specific file for a single version of a given document + api_response = await api_instance.documents_id_versions_version_id_items_version_item_id_download_get(id, version_id, version_item_id) + print("The response of DocumentVersionApi->documents_id_versions_version_id_items_version_item_id_download_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DocumentVersionApi->documents_id_versions_version_id_items_version_item_id_download_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of document | + **version_id** | **int**| ID of document version | + **version_item_id** | **int**| ID of document version item | + +### Return type + +**bytes** + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/pdf, text/xml + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Document Version does not exist | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/DocumentVersionItem.md b/generated/sync/docs/DocumentVersionItem.md new file mode 100644 index 0000000..a699389 --- /dev/null +++ b/generated/sync/docs/DocumentVersionItem.md @@ -0,0 +1,30 @@ +# DocumentVersionItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**document_version_item_type** | **str** | | [optional] [readonly] +**id** | **int** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_sync.models.document_version_item import DocumentVersionItem + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentVersionItem from a JSON string +document_version_item_instance = DocumentVersionItem.from_json(json) +# print the JSON string representation of the object +print(DocumentVersionItem.to_json()) + +# convert the object into a dict +document_version_item_dict = document_version_item_instance.to_dict() +# create an instance of DocumentVersionItem from a dict +document_version_item_from_dict = DocumentVersionItem.from_dict(document_version_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/DocumentVersions.md b/generated/sync/docs/DocumentVersions.md new file mode 100644 index 0000000..b79c5d7 --- /dev/null +++ b/generated/sync/docs/DocumentVersions.md @@ -0,0 +1,33 @@ +# DocumentVersions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[DocumentVersion]**](DocumentVersion.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.document_versions import DocumentVersions + +# TODO update the JSON string below +json = "{}" +# create an instance of DocumentVersions from a JSON string +document_versions_instance = DocumentVersions.from_json(json) +# print the JSON string representation of the object +print(DocumentVersions.to_json()) + +# convert the object into a dict +document_versions_dict = document_versions_instance.to_dict() +# create an instance of DocumentVersions from a dict +document_versions_from_dict = DocumentVersions.from_dict(document_versions_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/Documents.md b/generated/sync/docs/Documents.md new file mode 100644 index 0000000..18903fd --- /dev/null +++ b/generated/sync/docs/Documents.md @@ -0,0 +1,33 @@ +# Documents + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Document]**](Document.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.documents import Documents + +# TODO update the JSON string below +json = "{}" +# create an instance of Documents from a JSON string +documents_instance = Documents.from_json(json) +# print the JSON string representation of the object +print(Documents.to_json()) + +# convert the object into a dict +documents_dict = documents_instance.to_dict() +# create an instance of Documents from a dict +documents_from_dict = Documents.from_dict(documents_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/FileFormatConfig.md b/generated/sync/docs/FileFormatConfig.md new file mode 100644 index 0000000..049316b --- /dev/null +++ b/generated/sync/docs/FileFormatConfig.md @@ -0,0 +1,29 @@ +# FileFormatConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | + +## Example + +```python +from easybill_generated_sync.models.file_format_config import FileFormatConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of FileFormatConfig from a JSON string +file_format_config_instance = FileFormatConfig.from_json(json) +# print the JSON string representation of the object +print(FileFormatConfig.to_json()) + +# convert the object into a dict +file_format_config_dict = file_format_config_instance.to_dict() +# create an instance of FileFormatConfig from a dict +file_format_config_from_dict = FileFormatConfig.from_dict(file_format_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/List.md b/generated/sync/docs/List.md new file mode 100644 index 0000000..bb20842 --- /dev/null +++ b/generated/sync/docs/List.md @@ -0,0 +1,32 @@ +# List + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | + +## Example + +```python +from easybill_generated_sync.models.list import List + +# TODO update the JSON string below +json = "{}" +# create an instance of List from a JSON string +list_instance = List.from_json(json) +# print the JSON string representation of the object +print(List.to_json()) + +# convert the object into a dict +list_dict = list_instance.to_dict() +# create an instance of List from a dict +list_from_dict = List.from_dict(list_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/Login.md b/generated/sync/docs/Login.md new file mode 100644 index 0000000..cfcca28 --- /dev/null +++ b/generated/sync/docs/Login.md @@ -0,0 +1,39 @@ +# Login + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**first_name** | **str** | | [optional] +**last_name** | **str** | | [optional] +**display_name** | **str** | | [optional] [readonly] +**phone** | **str** | | [optional] +**email** | **str** | | [optional] +**email_signature** | **str** | | [optional] +**login_type** | **str** | | [optional] [default to 'ASSISTANT'] +**locale** | **str** | | [optional] +**time_zone** | **str** | | [optional] +**security** | [**LoginSecurity**](LoginSecurity.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.login import Login + +# TODO update the JSON string below +json = "{}" +# create an instance of Login from a JSON string +login_instance = Login.from_json(json) +# print the JSON string representation of the object +print(Login.to_json()) + +# convert the object into a dict +login_dict = login_instance.to_dict() +# create an instance of Login from a dict +login_from_dict = Login.from_dict(login_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/LoginSecurity.md b/generated/sync/docs/LoginSecurity.md new file mode 100644 index 0000000..4af4746 --- /dev/null +++ b/generated/sync/docs/LoginSecurity.md @@ -0,0 +1,32 @@ +# LoginSecurity + +This object is only displayed if your request the login resource as an admin. Otherwise this property will be null. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**two_factor_enabled** | **bool** | Shows if the login has two factor enabled for the login process | [optional] [readonly] [default to False] +**recovery_codes_enabled** | **bool** | Shows if the login has recovery codes enabled to bypass two factor | [optional] [readonly] [default to False] +**notify_on_new_login_enabled** | **bool** | Shows if the login has enabled to be notified if a new login is made from an unknown device. | [optional] [readonly] [default to True] + +## Example + +```python +from easybill_generated_sync.models.login_security import LoginSecurity + +# TODO update the JSON string below +json = "{}" +# create an instance of LoginSecurity from a JSON string +login_security_instance = LoginSecurity.from_json(json) +# print the JSON string representation of the object +print(LoginSecurity.to_json()) + +# convert the object into a dict +login_security_dict = login_security_instance.to_dict() +# create an instance of LoginSecurity from a dict +login_security_from_dict = LoginSecurity.from_dict(login_security_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/Logins.md b/generated/sync/docs/Logins.md new file mode 100644 index 0000000..daa861c --- /dev/null +++ b/generated/sync/docs/Logins.md @@ -0,0 +1,33 @@ +# Logins + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Login]**](Login.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.logins import Logins + +# TODO update the JSON string below +json = "{}" +# create an instance of Logins from a JSON string +logins_instance = Logins.from_json(json) +# print the JSON string representation of the object +print(Logins.to_json()) + +# convert the object into a dict +logins_dict = logins_instance.to_dict() +# create an instance of Logins from a dict +logins_from_dict = Logins.from_dict(logins_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/LoginsApi.md b/generated/sync/docs/LoginsApi.md new file mode 100644 index 0000000..6b931b5 --- /dev/null +++ b/generated/sync/docs/LoginsApi.md @@ -0,0 +1,176 @@ +# easybill_generated_sync.LoginsApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**logins_get**](LoginsApi.md#logins_get) | **GET** /logins | +[**logins_id_get**](LoginsApi.md#logins_id_get) | **GET** /logins/{id} | + + +# **logins_get** +> Logins logins_get(limit=limit, page=page) + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.logins import Logins +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.LoginsApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + api_response = await api_instance.logins_get(limit=limit, page=page) + print("The response of LoginsApi->logins_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LoginsApi->logins_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**Logins**](Logins.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logins_id_get** +> Login logins_id_get(id) + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.login import Login +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.LoginsApi(api_client) + id = 56 # int | ID of the login that needs to be fetched + + try: + api_response = await api_instance.logins_id_get(id) + print("The response of LoginsApi->logins_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LoginsApi->logins_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the login that needs to be fetched | + +### Return type + +[**Login**](Login.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/PDFTemplate.md b/generated/sync/docs/PDFTemplate.md new file mode 100644 index 0000000..7aa2199 --- /dev/null +++ b/generated/sync/docs/PDFTemplate.md @@ -0,0 +1,33 @@ +# PDFTemplate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] [default to 'INVOICE-DE'] +**name** | **str** | | [optional] [default to 'Default template'] +**pdf_template** | **str** | | [optional] [default to 'DE'] +**document_type** | **str** | | [optional] [default to 'INVOICE'] +**settings** | [**PDFTemplateSettings**](PDFTemplateSettings.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.pdf_template import PDFTemplate + +# TODO update the JSON string below +json = "{}" +# create an instance of PDFTemplate from a JSON string +pdf_template_instance = PDFTemplate.from_json(json) +# print the JSON string representation of the object +print(PDFTemplate.to_json()) + +# convert the object into a dict +pdf_template_dict = pdf_template_instance.to_dict() +# create an instance of PDFTemplate from a dict +pdf_template_from_dict = PDFTemplate.from_dict(pdf_template_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/PDFTemplateSettings.md b/generated/sync/docs/PDFTemplateSettings.md new file mode 100644 index 0000000..c4a65b4 --- /dev/null +++ b/generated/sync/docs/PDFTemplateSettings.md @@ -0,0 +1,31 @@ +# PDFTemplateSettings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**text_prefix** | **str** | | [optional] [default to ''] +**text** | **str** | | [optional] [default to ''] +**email** | [**PDFTemplateSettingsEmail**](PDFTemplateSettingsEmail.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.pdf_template_settings import PDFTemplateSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of PDFTemplateSettings from a JSON string +pdf_template_settings_instance = PDFTemplateSettings.from_json(json) +# print the JSON string representation of the object +print(PDFTemplateSettings.to_json()) + +# convert the object into a dict +pdf_template_settings_dict = pdf_template_settings_instance.to_dict() +# create an instance of PDFTemplateSettings from a dict +pdf_template_settings_from_dict = PDFTemplateSettings.from_dict(pdf_template_settings_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/PDFTemplateSettingsEmail.md b/generated/sync/docs/PDFTemplateSettingsEmail.md new file mode 100644 index 0000000..ddec472 --- /dev/null +++ b/generated/sync/docs/PDFTemplateSettingsEmail.md @@ -0,0 +1,30 @@ +# PDFTemplateSettingsEmail + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**subject** | **str** | | [optional] [default to ''] +**message** | **str** | | [optional] [default to ''] + +## Example + +```python +from easybill_generated_sync.models.pdf_template_settings_email import PDFTemplateSettingsEmail + +# TODO update the JSON string below +json = "{}" +# create an instance of PDFTemplateSettingsEmail from a JSON string +pdf_template_settings_email_instance = PDFTemplateSettingsEmail.from_json(json) +# print the JSON string representation of the object +print(PDFTemplateSettingsEmail.to_json()) + +# convert the object into a dict +pdf_template_settings_email_dict = pdf_template_settings_email_instance.to_dict() +# create an instance of PDFTemplateSettingsEmail from a dict +pdf_template_settings_email_from_dict = PDFTemplateSettingsEmail.from_dict(pdf_template_settings_email_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/PDFTemplates.md b/generated/sync/docs/PDFTemplates.md new file mode 100644 index 0000000..c9fc1ea --- /dev/null +++ b/generated/sync/docs/PDFTemplates.md @@ -0,0 +1,29 @@ +# PDFTemplates + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**List[PDFTemplate]**](PDFTemplate.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.pdf_templates import PDFTemplates + +# TODO update the JSON string below +json = "{}" +# create an instance of PDFTemplates from a JSON string +pdf_templates_instance = PDFTemplates.from_json(json) +# print the JSON string representation of the object +print(PDFTemplates.to_json()) + +# convert the object into a dict +pdf_templates_dict = pdf_templates_instance.to_dict() +# create an instance of PDFTemplates from a dict +pdf_templates_from_dict = PDFTemplates.from_dict(pdf_templates_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/PdfTemplatesApi.md b/generated/sync/docs/PdfTemplatesApi.md new file mode 100644 index 0000000..90cf786 --- /dev/null +++ b/generated/sync/docs/PdfTemplatesApi.md @@ -0,0 +1,94 @@ +# easybill_generated_sync.PdfTemplatesApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**pdf_templates_get**](PdfTemplatesApi.md#pdf_templates_get) | **GET** /pdf-templates | Fetch PDF Templates list + + +# **pdf_templates_get** +> PDFTemplates pdf_templates_get(type=type) + +Fetch PDF Templates list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.pdf_templates import PDFTemplates +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.PdfTemplatesApi(api_client) + type = ['type_example'] # List[str] | Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type. (optional) + + try: + # Fetch PDF Templates list + api_response = await api_instance.pdf_templates_get(type=type) + print("The response of PdfTemplatesApi->pdf_templates_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PdfTemplatesApi->pdf_templates_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **type** | [**List[str]**](str.md)| Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type. | [optional] + +### Return type + +[**PDFTemplates**](PDFTemplates.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/Position.md b/generated/sync/docs/Position.md new file mode 100644 index 0000000..4d6a656 --- /dev/null +++ b/generated/sync/docs/Position.md @@ -0,0 +1,61 @@ +# Position + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**type** | **str** | | [optional] [default to 'PRODUCT'] +**number** | **str** | | +**description** | **str** | The positions name or description | +**document_note** | **str** | This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction. | [optional] +**note** | **str** | Note for internal use | [optional] [default to 'null'] +**unit** | **str** | | [optional] [default to 'null'] +**export_identifier** | **str** | The FAS-Account is the four-digit revenue account, in which the revenue will be entered when doing the export to your tax consultant. In case you want to split your revenue to several revenue accounts, please talk to your tax consultant before, to guarantee an unobstructed use of the interface. For every revenue element, there are number ranges, which can be used. Please avoid using combinations of numbers, which can not be used by your tax consultant. | [optional] [default to 'null'] +**export_identifier_extended** | [**PositionExportIdentifierExtended**](PositionExportIdentifierExtended.md) | | [optional] +**login_id** | **int** | | [optional] [readonly] +**price_type** | **str** | | [optional] [default to 'NETTO'] +**vat_percent** | **float** | | [optional] [default to 19.0] +**sale_price** | **float** | Price in cents (e.g. \"150\" = 1.50€) | +**sale_price2** | **float** | Price for customers of group 2 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price3** | **float** | Price for customers of group 3 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price4** | **float** | Price for customers of group 4 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price5** | **float** | Price for customers of group 5 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price6** | **float** | Price for customers of group 6 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price7** | **float** | Price for customers of group 7 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price8** | **float** | Price for customers of group 8 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price9** | **float** | Price for customers of group 9 in cents (e.g. \"150\" = 1.50€) | [optional] +**sale_price10** | **float** | Price for customers of group 10 in cents (e.g. \"150\" = 1.50€) | [optional] +**cost_price** | **float** | Price in cents (e.g. \"150\" = 1.50€) | [optional] +**export_cost1** | **str** | | [optional] [default to 'null'] +**export_cost2** | **str** | | [optional] [default to 'null'] +**group_id** | **int** | | [optional] +**stock** | **str** | Activates stock management for this position | [optional] [default to 'NO'] +**stock_count** | **int** | Current stock count | [optional] [readonly] +**stock_limit_notify** | **bool** | Notify when stock_count is lower than stock_limit | [optional] [default to False] +**stock_limit_notify_frequency** | **str** | Notify frequency when stock_count is lower than stock_limit (ALWAYS, ONCE) | [optional] [default to 'ALWAYS'] +**stock_limit** | **int** | | [optional] +**quantity** | **float** | Used as the default quantity when adding this position to a document | [optional] +**archived** | **bool** | | [optional] [default to False] + +## Example + +```python +from easybill_generated_sync.models.position import Position + +# TODO update the JSON string below +json = "{}" +# create an instance of Position from a JSON string +position_instance = Position.from_json(json) +# print the JSON string representation of the object +print(Position.to_json()) + +# convert the object into a dict +position_dict = position_instance.to_dict() +# create an instance of Position from a dict +position_from_dict = Position.from_dict(position_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/PositionApi.md b/generated/sync/docs/PositionApi.md new file mode 100644 index 0000000..ee12639 --- /dev/null +++ b/generated/sync/docs/PositionApi.md @@ -0,0 +1,446 @@ +# easybill_generated_sync.PositionApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**positions_get**](PositionApi.md#positions_get) | **GET** /positions | Fetch positions list +[**positions_id_delete**](PositionApi.md#positions_id_delete) | **DELETE** /positions/{id} | Delete position +[**positions_id_get**](PositionApi.md#positions_id_get) | **GET** /positions/{id} | Fetch position +[**positions_id_put**](PositionApi.md#positions_id_put) | **PUT** /positions/{id} | Update position +[**positions_post**](PositionApi.md#positions_post) | **POST** /positions | Create position + + +# **positions_get** +> Positions positions_get(limit=limit, page=page, type=type, number=number) + +Fetch positions list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.positions import Positions +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.PositionApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + type = 'type_example' # str | Filter positions by type. (optional) + number = 'number_example' # str | Filter positions by number. You can add multiple numbers separate by comma like no,no,no. (optional) + + try: + # Fetch positions list + api_response = await api_instance.positions_get(limit=limit, page=page, type=type, number=number) + print("The response of PositionApi->positions_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionApi->positions_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **type** | **str**| Filter positions by type. | [optional] + **number** | **str**| Filter positions by number. You can add multiple numbers separate by comma like no,no,no. | [optional] + +### Return type + +[**Positions**](Positions.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **positions_id_delete** +> positions_id_delete(id) + +Delete position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.PositionApi(api_client) + id = 56 # int | ID of position + + try: + # Delete position + await api_instance.positions_id_delete(id) + except Exception as e: + print("Exception when calling PositionApi->positions_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of position | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **positions_id_get** +> Position positions_id_get(id) + +Fetch position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.position import Position +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.PositionApi(api_client) + id = 56 # int | ID of position + + try: + # Fetch position + api_response = await api_instance.positions_id_get(id) + print("The response of PositionApi->positions_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionApi->positions_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of position | + +### Return type + +[**Position**](Position.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **positions_id_put** +> Position positions_id_put(id, body) + +Update position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.position import Position +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.PositionApi(api_client) + id = 56 # int | ID of position + body = easybill_generated_sync.Position() # Position | + + try: + # Update position + api_response = await api_instance.positions_id_put(id, body) + print("The response of PositionApi->positions_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionApi->positions_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of position | + **body** | [**Position**](Position.md)| | + +### Return type + +[**Position**](Position.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid position | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **positions_post** +> Position positions_post(body) + +Create position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.position import Position +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.PositionApi(api_client) + body = easybill_generated_sync.Position() # Position | + + try: + # Create position + api_response = await api_instance.positions_post(body) + print("The response of PositionApi->positions_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionApi->positions_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Position**](Position.md)| | + +### Return type + +[**Position**](Position.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/PositionExportIdentifierExtended.md b/generated/sync/docs/PositionExportIdentifierExtended.md new file mode 100644 index 0000000..be9d822 --- /dev/null +++ b/generated/sync/docs/PositionExportIdentifierExtended.md @@ -0,0 +1,38 @@ +# PositionExportIdentifierExtended + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**null** | **str** | Umsatzsteuerpflichtig | [optional] [default to 'null'] +**n_stb** | **str** | Nicht steuerbar (Drittland) | [optional] [default to 'null'] +**n_stb_ust_id** | **str** | Nicht steuerbar (EU mit USt-IdNr.) | [optional] [default to 'null'] +**n_stb_none_ust_id** | **str** | Nicht steuerbar (EU ohne USt-IdNr.) | [optional] [default to 'null'] +**n_stb_im** | **str** | Nicht steuerbarer Innenumsatz | [optional] [default to 'null'] +**revc** | **str** | Steuerschuldwechsel §13b (Inland) | [optional] [default to 'null'] +**ig** | **str** | Innergemeinschaftliche Lieferung | [optional] [default to 'null'] +**al** | **str** | Ausfuhrlieferung | [optional] [default to 'null'] +**s_stfr** | **str** | sonstige Steuerbefreiung | [optional] [default to 'null'] +**small_business** | **str** | Kleinunternehmen (Keine MwSt.) | [optional] [default to 'null'] + +## Example + +```python +from easybill_generated_sync.models.position_export_identifier_extended import PositionExportIdentifierExtended + +# TODO update the JSON string below +json = "{}" +# create an instance of PositionExportIdentifierExtended from a JSON string +position_export_identifier_extended_instance = PositionExportIdentifierExtended.from_json(json) +# print the JSON string representation of the object +print(PositionExportIdentifierExtended.to_json()) + +# convert the object into a dict +position_export_identifier_extended_dict = position_export_identifier_extended_instance.to_dict() +# create an instance of PositionExportIdentifierExtended from a dict +position_export_identifier_extended_from_dict = PositionExportIdentifierExtended.from_dict(position_export_identifier_extended_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/PositionGroup.md b/generated/sync/docs/PositionGroup.md new file mode 100644 index 0000000..cf52a40 --- /dev/null +++ b/generated/sync/docs/PositionGroup.md @@ -0,0 +1,34 @@ +# PositionGroup + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] [default to 'null'] +**login_id** | **int** | | [optional] [readonly] +**name** | **str** | | +**number** | **str** | | +**display_name** | **str** | | [optional] [readonly] +**id** | **int** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_sync.models.position_group import PositionGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of PositionGroup from a JSON string +position_group_instance = PositionGroup.from_json(json) +# print the JSON string representation of the object +print(PositionGroup.to_json()) + +# convert the object into a dict +position_group_dict = position_group_instance.to_dict() +# create an instance of PositionGroup from a dict +position_group_from_dict = PositionGroup.from_dict(position_group_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/PositionGroupApi.md b/generated/sync/docs/PositionGroupApi.md new file mode 100644 index 0000000..01f8a3b --- /dev/null +++ b/generated/sync/docs/PositionGroupApi.md @@ -0,0 +1,442 @@ +# easybill_generated_sync.PositionGroupApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**position_groups_get**](PositionGroupApi.md#position_groups_get) | **GET** /position-groups | Fetch position group list +[**position_groups_id_delete**](PositionGroupApi.md#position_groups_id_delete) | **DELETE** /position-groups/{id} | Delete position group +[**position_groups_id_get**](PositionGroupApi.md#position_groups_id_get) | **GET** /position-groups/{id} | Fetch position group +[**position_groups_id_put**](PositionGroupApi.md#position_groups_id_put) | **PUT** /position-groups/{id} | Update position group +[**position_groups_post**](PositionGroupApi.md#position_groups_post) | **POST** /position-groups | Create position group + + +# **position_groups_get** +> PositionGroups position_groups_get(limit=limit, page=page) + +Fetch position group list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.position_groups import PositionGroups +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.PositionGroupApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch position group list + api_response = await api_instance.position_groups_get(limit=limit, page=page) + print("The response of PositionGroupApi->position_groups_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionGroupApi->position_groups_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**PositionGroups**](PositionGroups.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **position_groups_id_delete** +> position_groups_id_delete(id) + +Delete position group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.PositionGroupApi(api_client) + id = 56 # int | ID of position group + + try: + # Delete position group + await api_instance.position_groups_id_delete(id) + except Exception as e: + print("Exception when calling PositionGroupApi->position_groups_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of position group | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **position_groups_id_get** +> PositionGroup position_groups_id_get(id) + +Fetch position group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.position_group import PositionGroup +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.PositionGroupApi(api_client) + id = 56 # int | ID of position group + + try: + # Fetch position group + api_response = await api_instance.position_groups_id_get(id) + print("The response of PositionGroupApi->position_groups_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionGroupApi->position_groups_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of position group | + +### Return type + +[**PositionGroup**](PositionGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **position_groups_id_put** +> PositionGroup position_groups_id_put(id, body) + +Update position group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.position_group import PositionGroup +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.PositionGroupApi(api_client) + id = 56 # int | ID of position goup + body = easybill_generated_sync.PositionGroup() # PositionGroup | + + try: + # Update position group + api_response = await api_instance.position_groups_id_put(id, body) + print("The response of PositionGroupApi->position_groups_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionGroupApi->position_groups_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of position goup | + **body** | [**PositionGroup**](PositionGroup.md)| | + +### Return type + +[**PositionGroup**](PositionGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid position group | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **position_groups_post** +> PositionGroup position_groups_post(body) + +Create position group + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.position_group import PositionGroup +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.PositionGroupApi(api_client) + body = easybill_generated_sync.PositionGroup() # PositionGroup | + + try: + # Create position group + api_response = await api_instance.position_groups_post(body) + print("The response of PositionGroupApi->position_groups_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PositionGroupApi->position_groups_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**PositionGroup**](PositionGroup.md)| | + +### Return type + +[**PositionGroup**](PositionGroup.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/PositionGroups.md b/generated/sync/docs/PositionGroups.md new file mode 100644 index 0000000..6375184 --- /dev/null +++ b/generated/sync/docs/PositionGroups.md @@ -0,0 +1,33 @@ +# PositionGroups + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[PositionGroup]**](PositionGroup.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.position_groups import PositionGroups + +# TODO update the JSON string below +json = "{}" +# create an instance of PositionGroups from a JSON string +position_groups_instance = PositionGroups.from_json(json) +# print the JSON string representation of the object +print(PositionGroups.to_json()) + +# convert the object into a dict +position_groups_dict = position_groups_instance.to_dict() +# create an instance of PositionGroups from a dict +position_groups_from_dict = PositionGroups.from_dict(position_groups_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/Positions.md b/generated/sync/docs/Positions.md new file mode 100644 index 0000000..2104f1a --- /dev/null +++ b/generated/sync/docs/Positions.md @@ -0,0 +1,33 @@ +# Positions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Position]**](Position.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.positions import Positions + +# TODO update the JSON string below +json = "{}" +# create an instance of Positions from a JSON string +positions_instance = Positions.from_json(json) +# print the JSON string representation of the object +print(Positions.to_json()) + +# convert the object into a dict +positions_dict = positions_instance.to_dict() +# create an instance of Positions from a dict +positions_from_dict = Positions.from_dict(positions_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/PostBox.md b/generated/sync/docs/PostBox.md new file mode 100644 index 0000000..c89a9e8 --- /dev/null +++ b/generated/sync/docs/PostBox.md @@ -0,0 +1,47 @@ +# PostBox + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**document_id** | **int** | | [optional] +**to** | **str** | | [optional] +**cc** | **str** | | [optional] +**var_from** | **str** | | [optional] +**subject** | **str** | | [optional] +**message** | **str** | | [optional] +**var_date** | **date** | | [optional] +**created_at** | **datetime** | | [optional] +**processed_at** | **datetime** | | [optional] +**send_by_self** | **bool** | | [optional] +**send_with_attachment** | **bool** | | [optional] +**type** | **str** | | [optional] +**status** | **str** | | [optional] +**status_msg** | **str** | | [optional] +**login_id** | **int** | | [optional] [readonly] +**document_file_type** | **str** | | [optional] +**post_send_type** | **str** | This value indicates what method is used when the document is send via mail. The different types are offered by the german post as additional services. The registered mail options will include a tracking number which will be added to the postbox when known. If the value is omitted or empty when a postbox is created with the type \"POST\" post_send_type_standard will be used. For postbox with a different type than \"POST\" this field will hold a empty string. | [optional] +**tracking_identifier** | **str** | If the document is send with one of the registered send types stated for post_send_type, a tracking identifier will be added to the postbox at a later point when the tracking identifier is provided by our service partner. | [optional] [readonly] + +## Example + +```python +from easybill_generated_sync.models.post_box import PostBox + +# TODO update the JSON string below +json = "{}" +# create an instance of PostBox from a JSON string +post_box_instance = PostBox.from_json(json) +# print the JSON string representation of the object +print(PostBox.to_json()) + +# convert the object into a dict +post_box_dict = post_box_instance.to_dict() +# create an instance of PostBox from a dict +post_box_from_dict = PostBox.from_dict(post_box_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/PostBoxApi.md b/generated/sync/docs/PostBoxApi.md new file mode 100644 index 0000000..7392bf9 --- /dev/null +++ b/generated/sync/docs/PostBoxApi.md @@ -0,0 +1,273 @@ +# easybill_generated_sync.PostBoxApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**post_boxes_get**](PostBoxApi.md#post_boxes_get) | **GET** /post-boxes | Fetch post box list +[**post_boxes_id_delete**](PostBoxApi.md#post_boxes_id_delete) | **DELETE** /post-boxes/{id} | Delete post box +[**post_boxes_id_get**](PostBoxApi.md#post_boxes_id_get) | **GET** /post-boxes/{id} | Fetch post box + + +# **post_boxes_get** +> PostBoxes post_boxes_get(limit=limit, page=page, type=type, status=status, document_id=document_id) + +Fetch post box list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.post_boxes import PostBoxes +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.PostBoxApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + type = 'type_example' # str | Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX. (optional) + status = 'status_example' # str | Filter post boxes by status. (optional) + document_id = 'document_id_example' # str | Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id. (optional) + + try: + # Fetch post box list + api_response = await api_instance.post_boxes_get(limit=limit, page=page, type=type, status=status, document_id=document_id) + print("The response of PostBoxApi->post_boxes_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PostBoxApi->post_boxes_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **type** | **str**| Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX. | [optional] + **status** | **str**| Filter post boxes by status. | [optional] + **document_id** | **str**| Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id. | [optional] + +### Return type + +[**PostBoxes**](PostBoxes.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_boxes_id_delete** +> post_boxes_id_delete(id) + +Delete post box + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.PostBoxApi(api_client) + id = 56 # int | ID of post box + + try: + # Delete post box + await api_instance.post_boxes_id_delete(id) + except Exception as e: + print("Exception when calling PostBoxApi->post_boxes_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of post box | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **post_boxes_id_get** +> PostBox post_boxes_id_get(id) + +Fetch post box + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.post_box import PostBox +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.PostBoxApi(api_client) + id = 56 # int | ID of post box + + try: + # Fetch post box + api_response = await api_instance.post_boxes_id_get(id) + print("The response of PostBoxApi->post_boxes_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PostBoxApi->post_boxes_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of post box | + +### Return type + +[**PostBox**](PostBox.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/PostBoxRequest.md b/generated/sync/docs/PostBoxRequest.md new file mode 100644 index 0000000..390e6ad --- /dev/null +++ b/generated/sync/docs/PostBoxRequest.md @@ -0,0 +1,38 @@ +# PostBoxRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**to** | **str** | | [optional] +**cc** | **str** | | [optional] +**var_from** | **str** | | [optional] +**subject** | **str** | | [optional] +**message** | **str** | | [optional] +**var_date** | **date** | | [optional] +**send_by_self** | **bool** | | [optional] +**send_with_attachment** | **bool** | | [optional] [default to True] +**document_file_type** | **str** | When set to null, the setting on the customer is used | [optional] +**post_send_type** | **str** | This value indicates what method is used when the document is send via mail. The different types are offered by the german post as additional services. The registered mail options will include a tracking number which will be added to the postbox when known. If the value is omitted or empty when a postbox is created with the type \"POST\" post_send_type_standard will be used. For postbox with a different type than \"POST\" this field will hold a empty string. | [optional] + +## Example + +```python +from easybill_generated_sync.models.post_box_request import PostBoxRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of PostBoxRequest from a JSON string +post_box_request_instance = PostBoxRequest.from_json(json) +# print the JSON string representation of the object +print(PostBoxRequest.to_json()) + +# convert the object into a dict +post_box_request_dict = post_box_request_instance.to_dict() +# create an instance of PostBoxRequest from a dict +post_box_request_from_dict = PostBoxRequest.from_dict(post_box_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/PostBoxes.md b/generated/sync/docs/PostBoxes.md new file mode 100644 index 0000000..d222f77 --- /dev/null +++ b/generated/sync/docs/PostBoxes.md @@ -0,0 +1,33 @@ +# PostBoxes + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[PostBox]**](PostBox.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.post_boxes import PostBoxes + +# TODO update the JSON string below +json = "{}" +# create an instance of PostBoxes from a JSON string +post_boxes_instance = PostBoxes.from_json(json) +# print the JSON string representation of the object +print(PostBoxes.to_json()) + +# convert the object into a dict +post_boxes_dict = post_boxes_instance.to_dict() +# create an instance of PostBoxes from a dict +post_boxes_from_dict = PostBoxes.from_dict(post_boxes_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/Project.md b/generated/sync/docs/Project.md new file mode 100644 index 0000000..5245904 --- /dev/null +++ b/generated/sync/docs/Project.md @@ -0,0 +1,41 @@ +# Project + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**budget_amount** | **int** | Project budget in cents (e.g. \"150\" = 1.50€) | [optional] +**budget_time** | **int** | Time budget in minutes (e.g. \"90\" = 1 hour and 30 minutes) | [optional] +**customer_id** | **int** | | [optional] +**hourly_rate** | **float** | Hourly rate in cents (e.g. \"150\" = 1.50€) | [optional] +**id** | **int** | | [optional] [readonly] +**login_id** | **int** | If omitted or null, the currently active login is used | [optional] +**name** | **str** | | +**note** | **str** | | [optional] [default to 'null'] +**status** | **str** | | [optional] [default to 'OPEN'] +**due_at** | **date** | | [optional] +**budget_notify_frequency** | **str** | | [optional] [default to 'ALWAYS'] +**consumed_time** | **int** | | [optional] [readonly] +**consumed_amount** | **int** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_sync.models.project import Project + +# TODO update the JSON string below +json = "{}" +# create an instance of Project from a JSON string +project_instance = Project.from_json(json) +# print the JSON string representation of the object +print(Project.to_json()) + +# convert the object into a dict +project_dict = project_instance.to_dict() +# create an instance of Project from a dict +project_from_dict = Project.from_dict(project_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/ProjectApi.md b/generated/sync/docs/ProjectApi.md new file mode 100644 index 0000000..52ddbe9 --- /dev/null +++ b/generated/sync/docs/ProjectApi.md @@ -0,0 +1,446 @@ +# easybill_generated_sync.ProjectApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**projects_get**](ProjectApi.md#projects_get) | **GET** /projects | Fetch projects list +[**projects_id_delete**](ProjectApi.md#projects_id_delete) | **DELETE** /projects/{id} | Delete project +[**projects_id_get**](ProjectApi.md#projects_id_get) | **GET** /projects/{id} | Fetch project +[**projects_id_put**](ProjectApi.md#projects_id_put) | **PUT** /projects/{id} | Update project +[**projects_post**](ProjectApi.md#projects_post) | **POST** /projects | Create project + + +# **projects_get** +> Projects projects_get(limit=limit, page=page, customer_id=customer_id, status=status) + +Fetch projects list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.projects import Projects +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.ProjectApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + customer_id = 'customer_id_example' # str | Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id. (optional) + status = 'status_example' # str | Filter projects by status. (optional) + + try: + # Fetch projects list + api_response = await api_instance.projects_get(limit=limit, page=page, customer_id=customer_id, status=status) + print("The response of ProjectApi->projects_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->projects_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **customer_id** | **str**| Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id. | [optional] + **status** | **str**| Filter projects by status. | [optional] + +### Return type + +[**Projects**](Projects.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **projects_id_delete** +> projects_id_delete(id) + +Delete project + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.ProjectApi(api_client) + id = 56 # int | ID of project + + try: + # Delete project + await api_instance.projects_id_delete(id) + except Exception as e: + print("Exception when calling ProjectApi->projects_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of project | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **projects_id_get** +> Project projects_id_get(id) + +Fetch project + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.project import Project +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.ProjectApi(api_client) + id = 56 # int | ID of project + + try: + # Fetch project + api_response = await api_instance.projects_id_get(id) + print("The response of ProjectApi->projects_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->projects_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of project | + +### Return type + +[**Project**](Project.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **projects_id_put** +> Project projects_id_put(id, body) + +Update project + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.project import Project +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.ProjectApi(api_client) + id = 56 # int | ID of project + body = easybill_generated_sync.Project() # Project | + + try: + # Update project + api_response = await api_instance.projects_id_put(id, body) + print("The response of ProjectApi->projects_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->projects_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of project | + **body** | [**Project**](Project.md)| | + +### Return type + +[**Project**](Project.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid project | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **projects_post** +> Project projects_post(body) + +Create project + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.project import Project +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.ProjectApi(api_client) + body = easybill_generated_sync.Project() # Project | + + try: + # Create project + api_response = await api_instance.projects_post(body) + print("The response of ProjectApi->projects_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->projects_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Project**](Project.md)| | + +### Return type + +[**Project**](Project.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/Projects.md b/generated/sync/docs/Projects.md new file mode 100644 index 0000000..2b1e7b9 --- /dev/null +++ b/generated/sync/docs/Projects.md @@ -0,0 +1,33 @@ +# Projects + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Project]**](Project.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.projects import Projects + +# TODO update the JSON string below +json = "{}" +# create an instance of Projects from a JSON string +projects_instance = Projects.from_json(json) +# print the JSON string representation of the object +print(Projects.to_json()) + +# convert the object into a dict +projects_dict = projects_instance.to_dict() +# create an instance of Projects from a dict +projects_from_dict = Projects.from_dict(projects_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/SEPAPayment.md b/generated/sync/docs/SEPAPayment.md new file mode 100644 index 0000000..c853f88 --- /dev/null +++ b/generated/sync/docs/SEPAPayment.md @@ -0,0 +1,52 @@ +# SEPAPayment + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **int** | Amount in cents (e.g. \"150\" = 1.50€) | +**created_at** | **datetime** | | [optional] [readonly] +**creditor_bic** | **str** | If type is DEBIT, this field is overwritten with the selected bank account data on export. | [optional] [default to 'null'] +**creditor_iban** | **str** | Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export. | [optional] +**creditor_name** | **str** | Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export. | [optional] +**debitor_bic** | **str** | If type is CREDIT, this field is overwritten with the selected bank account data on export. | [optional] [default to 'null'] +**debitor_iban** | **str** | Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export. | +**debitor_name** | **str** | Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export. | +**debitor_address_line_1** | **str** | Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA | [optional] +**debitor_address_line2** | **str** | string | [optional] +**debitor_country** | **str** | Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA | [optional] +**document_id** | **int** | | +**export_at** | **datetime** | If a date is set, this record is marked as exported | [optional] +**export_error** | **str** | | [optional] [readonly] +**id** | **int** | | [optional] [readonly] +**local_instrument** | **str** | CORE: SEPA Core Direct Debit<br/> COR1: SEPA-Basislastschrift COR1 (deprecated use CORE instead)<br/> B2B: SEPA Business to Business Direct Debit | +**mandate_date_of_signature** | **date** | | +**mandate_id** | **str** | | +**reference** | **str** | | +**remittance_information** | **str** | | [optional] [default to 'null'] +**requested_at** | **date** | Booking date | [optional] +**sequence_type** | **str** | FRST: Erstlastschrift<br/> RCUR: Folgelastschrift<br/> OOFF: Einmallastschrift<br/> FNAL: Letztmalige Lastschrift | +**updated_at** | **str** | | [optional] [readonly] +**type** | **str** | | [optional] [default to 'DEBIT'] + +## Example + +```python +from easybill_generated_sync.models.sepa_payment import SEPAPayment + +# TODO update the JSON string below +json = "{}" +# create an instance of SEPAPayment from a JSON string +sepa_payment_instance = SEPAPayment.from_json(json) +# print the JSON string representation of the object +print(SEPAPayment.to_json()) + +# convert the object into a dict +sepa_payment_dict = sepa_payment_instance.to_dict() +# create an instance of SEPAPayment from a dict +sepa_payment_from_dict = SEPAPayment.from_dict(sepa_payment_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/SEPAPayments.md b/generated/sync/docs/SEPAPayments.md new file mode 100644 index 0000000..a20940f --- /dev/null +++ b/generated/sync/docs/SEPAPayments.md @@ -0,0 +1,33 @@ +# SEPAPayments + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[SEPAPayment]**](SEPAPayment.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.sepa_payments import SEPAPayments + +# TODO update the JSON string below +json = "{}" +# create an instance of SEPAPayments from a JSON string +sepa_payments_instance = SEPAPayments.from_json(json) +# print the JSON string representation of the object +print(SEPAPayments.to_json()) + +# convert the object into a dict +sepa_payments_dict = sepa_payments_instance.to_dict() +# create an instance of SEPAPayments from a dict +sepa_payments_from_dict = SEPAPayments.from_dict(sepa_payments_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/SepaPaymentApi.md b/generated/sync/docs/SepaPaymentApi.md new file mode 100644 index 0000000..e921f4d --- /dev/null +++ b/generated/sync/docs/SepaPaymentApi.md @@ -0,0 +1,444 @@ +# easybill_generated_sync.SepaPaymentApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**sepa_payments_get**](SepaPaymentApi.md#sepa_payments_get) | **GET** /sepa-payments | Fetch SEPA payments list +[**sepa_payments_id_delete**](SepaPaymentApi.md#sepa_payments_id_delete) | **DELETE** /sepa-payments/{id} | Delete SEPA payment +[**sepa_payments_id_get**](SepaPaymentApi.md#sepa_payments_id_get) | **GET** /sepa-payments/{id} | Fetch SEPA payment +[**sepa_payments_id_put**](SepaPaymentApi.md#sepa_payments_id_put) | **PUT** /sepa-payments/{id} | Update SEPA payment +[**sepa_payments_post**](SepaPaymentApi.md#sepa_payments_post) | **POST** /sepa-payments | Create SEPA payment + + +# **sepa_payments_get** +> SEPAPayments sepa_payments_get(limit=limit, page=page, document_id=document_id) + +Fetch SEPA payments list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.sepa_payments import SEPAPayments +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.SepaPaymentApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + document_id = 'document_id_example' # str | Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id. (optional) + + try: + # Fetch SEPA payments list + api_response = await api_instance.sepa_payments_get(limit=limit, page=page, document_id=document_id) + print("The response of SepaPaymentApi->sepa_payments_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SepaPaymentApi->sepa_payments_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **document_id** | **str**| Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id. | [optional] + +### Return type + +[**SEPAPayments**](SEPAPayments.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sepa_payments_id_delete** +> sepa_payments_id_delete(id) + +Delete SEPA payment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.SepaPaymentApi(api_client) + id = 56 # int | ID of SPEA payment + + try: + # Delete SEPA payment + await api_instance.sepa_payments_id_delete(id) + except Exception as e: + print("Exception when calling SepaPaymentApi->sepa_payments_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of SPEA payment | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sepa_payments_id_get** +> SEPAPayment sepa_payments_id_get(id) + +Fetch SEPA payment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.sepa_payment import SEPAPayment +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.SepaPaymentApi(api_client) + id = 56 # int | ID of SEPA payment + + try: + # Fetch SEPA payment + api_response = await api_instance.sepa_payments_id_get(id) + print("The response of SepaPaymentApi->sepa_payments_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SepaPaymentApi->sepa_payments_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of SEPA payment | + +### Return type + +[**SEPAPayment**](SEPAPayment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sepa_payments_id_put** +> SEPAPayment sepa_payments_id_put(id, body) + +Update SEPA payment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.sepa_payment import SEPAPayment +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.SepaPaymentApi(api_client) + id = 56 # int | ID of SEPA payment + body = easybill_generated_sync.SEPAPayment() # SEPAPayment | + + try: + # Update SEPA payment + api_response = await api_instance.sepa_payments_id_put(id, body) + print("The response of SepaPaymentApi->sepa_payments_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SepaPaymentApi->sepa_payments_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of SEPA payment | + **body** | [**SEPAPayment**](SEPAPayment.md)| | + +### Return type + +[**SEPAPayment**](SEPAPayment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid SEPA payment | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sepa_payments_post** +> SEPAPayment sepa_payments_post(body) + +Create SEPA payment + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.sepa_payment import SEPAPayment +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.SepaPaymentApi(api_client) + body = easybill_generated_sync.SEPAPayment() # SEPAPayment | + + try: + # Create SEPA payment + api_response = await api_instance.sepa_payments_post(body) + print("The response of SepaPaymentApi->sepa_payments_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SepaPaymentApi->sepa_payments_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SEPAPayment**](SEPAPayment.md)| | + +### Return type + +[**SEPAPayment**](SEPAPayment.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/SerialNumber.md b/generated/sync/docs/SerialNumber.md new file mode 100644 index 0000000..3cf8ddb --- /dev/null +++ b/generated/sync/docs/SerialNumber.md @@ -0,0 +1,35 @@ +# SerialNumber + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**serial_number** | **str** | | +**position_id** | **int** | | +**document_id** | **int** | | [optional] [readonly] +**document_position_id** | **int** | | [optional] [readonly] +**used_at** | **str** | | [optional] [readonly] +**created_at** | **str** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_sync.models.serial_number import SerialNumber + +# TODO update the JSON string below +json = "{}" +# create an instance of SerialNumber from a JSON string +serial_number_instance = SerialNumber.from_json(json) +# print the JSON string representation of the object +print(SerialNumber.to_json()) + +# convert the object into a dict +serial_number_dict = serial_number_instance.to_dict() +# create an instance of SerialNumber from a dict +serial_number_from_dict = SerialNumber.from_dict(serial_number_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/SerialNumberApi.md b/generated/sync/docs/SerialNumberApi.md new file mode 100644 index 0000000..191eeb8 --- /dev/null +++ b/generated/sync/docs/SerialNumberApi.md @@ -0,0 +1,361 @@ +# easybill_generated_sync.SerialNumberApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**serial_numbers_get**](SerialNumberApi.md#serial_numbers_get) | **GET** /serial-numbers | Fetch a list of serial numbers for positions +[**serial_numbers_id_delete**](SerialNumberApi.md#serial_numbers_id_delete) | **DELETE** /serial-numbers/{id} | Delete a serial number for a position +[**serial_numbers_id_get**](SerialNumberApi.md#serial_numbers_id_get) | **GET** /serial-numbers/{id} | Fetch a serial number for a position +[**serial_numbers_post**](SerialNumberApi.md#serial_numbers_post) | **POST** /serial-numbers | Create s serial number for a position + + +# **serial_numbers_get** +> SerialNumbers serial_numbers_get(limit=limit, page=page, position_id=position_id, document_id=document_id, in_use=in_use) + +Fetch a list of serial numbers for positions + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.serial_numbers import SerialNumbers +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.SerialNumberApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + position_id = 'position_id_example' # str | Filter serial numbers by position id. (optional) + document_id = 'document_id_example' # str | Filter serial numbers by document id. (optional) + in_use = True # bool | Filter serial numbers by usage. (optional) + + try: + # Fetch a list of serial numbers for positions + api_response = await api_instance.serial_numbers_get(limit=limit, page=page, position_id=position_id, document_id=document_id, in_use=in_use) + print("The response of SerialNumberApi->serial_numbers_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SerialNumberApi->serial_numbers_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **position_id** | **str**| Filter serial numbers by position id. | [optional] + **document_id** | **str**| Filter serial numbers by document id. | [optional] + **in_use** | **bool**| Filter serial numbers by usage. | [optional] + +### Return type + +[**SerialNumbers**](SerialNumbers.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **serial_numbers_id_delete** +> serial_numbers_id_delete(id) + +Delete a serial number for a position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.SerialNumberApi(api_client) + id = 56 # int | ID of the serial number that needs to be deleted + + try: + # Delete a serial number for a position + await api_instance.serial_numbers_id_delete(id) + except Exception as e: + print("Exception when calling SerialNumberApi->serial_numbers_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the serial number that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**400** | Serial number in use. Operation failed. | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **serial_numbers_id_get** +> SerialNumber serial_numbers_id_get(id) + +Fetch a serial number for a position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.serial_number import SerialNumber +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.SerialNumberApi(api_client) + id = 56 # int | ID of the serial number that needs to be fetched + + try: + # Fetch a serial number for a position + api_response = await api_instance.serial_numbers_id_get(id) + print("The response of SerialNumberApi->serial_numbers_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SerialNumberApi->serial_numbers_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the serial number that needs to be fetched | + +### Return type + +[**SerialNumber**](SerialNumber.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **serial_numbers_post** +> SerialNumber serial_numbers_post(body=body) + +Create s serial number for a position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.serial_number import SerialNumber +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.SerialNumberApi(api_client) + body = easybill_generated_sync.SerialNumber() # SerialNumber | (optional) + + try: + # Create s serial number for a position + api_response = await api_instance.serial_numbers_post(body=body) + print("The response of SerialNumberApi->serial_numbers_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SerialNumberApi->serial_numbers_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SerialNumber**](SerialNumber.md)| | [optional] + +### Return type + +[**SerialNumber**](SerialNumber.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid PositionID | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/SerialNumbers.md b/generated/sync/docs/SerialNumbers.md new file mode 100644 index 0000000..f070d61 --- /dev/null +++ b/generated/sync/docs/SerialNumbers.md @@ -0,0 +1,33 @@ +# SerialNumbers + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[SerialNumber]**](SerialNumber.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.serial_numbers import SerialNumbers + +# TODO update the JSON string below +json = "{}" +# create an instance of SerialNumbers from a JSON string +serial_numbers_instance = SerialNumbers.from_json(json) +# print the JSON string representation of the object +print(SerialNumbers.to_json()) + +# convert the object into a dict +serial_numbers_dict = serial_numbers_instance.to_dict() +# create an instance of SerialNumbers from a dict +serial_numbers_from_dict = SerialNumbers.from_dict(serial_numbers_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/ServiceDate.md b/generated/sync/docs/ServiceDate.md new file mode 100644 index 0000000..0f42646 --- /dev/null +++ b/generated/sync/docs/ServiceDate.md @@ -0,0 +1,34 @@ +# ServiceDate + +This object is only available in document type INVOICE or CREDIT. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | With DEFAULT no other fields are required and this message will be printed: 'Invoice date coincides with the time of supply'.<br/> For SERVICE or DELIVERY exactly one of the following fields must be set: date, date_from and date_to or text. | [optional] +**var_date** | **date** | | [optional] +**date_from** | **date** | | [optional] +**date_to** | **date** | | [optional] +**text** | **str** | | [optional] [default to 'null'] + +## Example + +```python +from easybill_generated_sync.models.service_date import ServiceDate + +# TODO update the JSON string below +json = "{}" +# create an instance of ServiceDate from a JSON string +service_date_instance = ServiceDate.from_json(json) +# print the JSON string representation of the object +print(ServiceDate.to_json()) + +# convert the object into a dict +service_date_dict = service_date_instance.to_dict() +# create an instance of ServiceDate from a dict +service_date_from_dict = ServiceDate.from_dict(service_date_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/Stock.md b/generated/sync/docs/Stock.md new file mode 100644 index 0000000..cb300c0 --- /dev/null +++ b/generated/sync/docs/Stock.md @@ -0,0 +1,37 @@ +# Stock + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] [readonly] +**note** | **str** | | [optional] +**stock_count** | **int** | | +**position_id** | **int** | | +**document_id** | **int** | | [optional] [readonly] +**document_position_id** | **int** | | [optional] [readonly] +**stored_at** | **str** | | [optional] +**created_at** | **str** | | [optional] [readonly] +**updated_at** | **str** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_sync.models.stock import Stock + +# TODO update the JSON string below +json = "{}" +# create an instance of Stock from a JSON string +stock_instance = Stock.from_json(json) +# print the JSON string representation of the object +print(Stock.to_json()) + +# convert the object into a dict +stock_dict = stock_instance.to_dict() +# create an instance of Stock from a dict +stock_from_dict = Stock.from_dict(stock_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/StockApi.md b/generated/sync/docs/StockApi.md new file mode 100644 index 0000000..cc00304 --- /dev/null +++ b/generated/sync/docs/StockApi.md @@ -0,0 +1,274 @@ +# easybill_generated_sync.StockApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**stocks_get**](StockApi.md#stocks_get) | **GET** /stocks | Fetch a list of stock entries for positions +[**stocks_id_get**](StockApi.md#stocks_id_get) | **GET** /stocks/{id} | Fetch an stock entry for a position +[**stocks_post**](StockApi.md#stocks_post) | **POST** /stocks | Create a stock entry for a position + + +# **stocks_get** +> Stocks stocks_get(limit=limit, page=page, position_id=position_id, document_id=document_id) + +Fetch a list of stock entries for positions + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.stocks import Stocks +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.StockApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + position_id = 'position_id_example' # str | Filter stock entries by position id. (optional) + document_id = 'document_id_example' # str | Filter stock entries by document id. (optional) + + try: + # Fetch a list of stock entries for positions + api_response = await api_instance.stocks_get(limit=limit, page=page, position_id=position_id, document_id=document_id) + print("The response of StockApi->stocks_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling StockApi->stocks_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **position_id** | **str**| Filter stock entries by position id. | [optional] + **document_id** | **str**| Filter stock entries by document id. | [optional] + +### Return type + +[**Stocks**](Stocks.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **stocks_id_get** +> Stock stocks_id_get(id) + +Fetch an stock entry for a position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.stock import Stock +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.StockApi(api_client) + id = 56 # int | ID of the stock entry that needs to be fetched + + try: + # Fetch an stock entry for a position + api_response = await api_instance.stocks_id_get(id) + print("The response of StockApi->stocks_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling StockApi->stocks_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of the stock entry that needs to be fetched | + +### Return type + +[**Stock**](Stock.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **stocks_post** +> Stock stocks_post(body) + +Create a stock entry for a position + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.stock import Stock +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.StockApi(api_client) + body = easybill_generated_sync.Stock() # Stock | + + try: + # Create a stock entry for a position + api_response = await api_instance.stocks_post(body) + print("The response of StockApi->stocks_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling StockApi->stocks_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Stock**](Stock.md)| | + +### Return type + +[**Stock**](Stock.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**400** | Invalid position_id or stock_count | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/Stocks.md b/generated/sync/docs/Stocks.md new file mode 100644 index 0000000..bcc54d7 --- /dev/null +++ b/generated/sync/docs/Stocks.md @@ -0,0 +1,33 @@ +# Stocks + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Stock]**](Stock.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.stocks import Stocks + +# TODO update the JSON string below +json = "{}" +# create an instance of Stocks from a JSON string +stocks_instance = Stocks.from_json(json) +# print the JSON string representation of the object +print(Stocks.to_json()) + +# convert the object into a dict +stocks_dict = stocks_instance.to_dict() +# create an instance of Stocks from a dict +stocks_from_dict = Stocks.from_dict(stocks_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/Task.md b/generated/sync/docs/Task.md new file mode 100644 index 0000000..97509e2 --- /dev/null +++ b/generated/sync/docs/Task.md @@ -0,0 +1,45 @@ +# Task + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | | [optional] [default to null] +**category_custom** | **str** | The name of your custom category. Can only have a value if \"category\" is \"CUSTOM\". | [optional] [default to 'null'] +**created_at** | **datetime** | | [optional] [readonly] +**customer_id** | **int** | | [optional] +**description** | **str** | | [optional] [default to 'null'] +**document_id** | **int** | | [optional] +**end_at** | **datetime** | The deadline | [optional] +**finish_at** | **datetime** | The time when the task was marked as done | [optional] [readonly] +**id** | **int** | | [optional] [readonly] +**login_id** | **int** | When omitted or null, the currently active login is used | [optional] +**name** | **str** | | +**position_id** | **int** | | [optional] +**priority** | **str** | | [optional] [default to 'NORMAL'] +**project_id** | **int** | | [optional] +**start_at** | **datetime** | | [optional] +**status** | **str** | | +**status_percent** | **int** | | [optional] + +## Example + +```python +from easybill_generated_sync.models.task import Task + +# TODO update the JSON string below +json = "{}" +# create an instance of Task from a JSON string +task_instance = Task.from_json(json) +# print the JSON string representation of the object +print(Task.to_json()) + +# convert the object into a dict +task_dict = task_instance.to_dict() +# create an instance of Task from a dict +task_from_dict = Task.from_dict(task_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/TaskApi.md b/generated/sync/docs/TaskApi.md new file mode 100644 index 0000000..122eb3c --- /dev/null +++ b/generated/sync/docs/TaskApi.md @@ -0,0 +1,442 @@ +# easybill_generated_sync.TaskApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**tasks_get**](TaskApi.md#tasks_get) | **GET** /tasks | Fetch tasks list +[**tasks_id_delete**](TaskApi.md#tasks_id_delete) | **DELETE** /tasks/{id} | Delete task +[**tasks_id_get**](TaskApi.md#tasks_id_get) | **GET** /tasks/{id} | Fetch task +[**tasks_id_put**](TaskApi.md#tasks_id_put) | **PUT** /tasks/{id} | Update task +[**tasks_post**](TaskApi.md#tasks_post) | **POST** /tasks | Create task + + +# **tasks_get** +> Tasks tasks_get(limit=limit, page=page) + +Fetch tasks list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.tasks import Tasks +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TaskApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch tasks list + api_response = await api_instance.tasks_get(limit=limit, page=page) + print("The response of TaskApi->tasks_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TaskApi->tasks_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**Tasks**](Tasks.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **tasks_id_delete** +> tasks_id_delete(id) + +Delete task + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TaskApi(api_client) + id = 56 # int | ID of task + + try: + # Delete task + await api_instance.tasks_id_delete(id) + except Exception as e: + print("Exception when calling TaskApi->tasks_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of task | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **tasks_id_get** +> Task tasks_id_get(id) + +Fetch task + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.task import Task +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TaskApi(api_client) + id = 56 # int | ID of task + + try: + # Fetch task + api_response = await api_instance.tasks_id_get(id) + print("The response of TaskApi->tasks_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TaskApi->tasks_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of task | + +### Return type + +[**Task**](Task.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **tasks_id_put** +> Task tasks_id_put(id, body) + +Update task + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.task import Task +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TaskApi(api_client) + id = 56 # int | ID of task + body = easybill_generated_sync.Task() # Task | + + try: + # Update task + api_response = await api_instance.tasks_id_put(id, body) + print("The response of TaskApi->tasks_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TaskApi->tasks_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of task | + **body** | [**Task**](Task.md)| | + +### Return type + +[**Task**](Task.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid task | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **tasks_post** +> Task tasks_post(body) + +Create task + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.task import Task +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TaskApi(api_client) + body = easybill_generated_sync.Task() # Task | + + try: + # Create task + api_response = await api_instance.tasks_post(body) + print("The response of TaskApi->tasks_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TaskApi->tasks_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Task**](Task.md)| | + +### Return type + +[**Task**](Task.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/Tasks.md b/generated/sync/docs/Tasks.md new file mode 100644 index 0000000..f94c0a3 --- /dev/null +++ b/generated/sync/docs/Tasks.md @@ -0,0 +1,33 @@ +# Tasks + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[Task]**](Task.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.tasks import Tasks + +# TODO update the JSON string below +json = "{}" +# create an instance of Tasks from a JSON string +tasks_instance = Tasks.from_json(json) +# print the JSON string representation of the object +print(Tasks.to_json()) + +# convert the object into a dict +tasks_dict = tasks_instance.to_dict() +# create an instance of Tasks from a dict +tasks_from_dict = Tasks.from_dict(tasks_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/TextTemplate.md b/generated/sync/docs/TextTemplate.md new file mode 100644 index 0000000..a2ee158 --- /dev/null +++ b/generated/sync/docs/TextTemplate.md @@ -0,0 +1,32 @@ +# TextTemplate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_modify** | **bool** | Deprecated, field is always true. | [optional] [readonly] +**id** | **int** | | [optional] [readonly] +**text** | **str** | | +**title** | **str** | | + +## Example + +```python +from easybill_generated_sync.models.text_template import TextTemplate + +# TODO update the JSON string below +json = "{}" +# create an instance of TextTemplate from a JSON string +text_template_instance = TextTemplate.from_json(json) +# print the JSON string representation of the object +print(TextTemplate.to_json()) + +# convert the object into a dict +text_template_dict = text_template_instance.to_dict() +# create an instance of TextTemplate from a dict +text_template_from_dict = TextTemplate.from_dict(text_template_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/TextTemplateApi.md b/generated/sync/docs/TextTemplateApi.md new file mode 100644 index 0000000..dd482d4 --- /dev/null +++ b/generated/sync/docs/TextTemplateApi.md @@ -0,0 +1,442 @@ +# easybill_generated_sync.TextTemplateApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**text_templates_get**](TextTemplateApi.md#text_templates_get) | **GET** /text-templates | Fetch text templates list +[**text_templates_id_delete**](TextTemplateApi.md#text_templates_id_delete) | **DELETE** /text-templates/{id} | Delete text template +[**text_templates_id_get**](TextTemplateApi.md#text_templates_id_get) | **GET** /text-templates/{id} | Fetch text template +[**text_templates_id_put**](TextTemplateApi.md#text_templates_id_put) | **PUT** /text-templates/{id} | Update text template +[**text_templates_post**](TextTemplateApi.md#text_templates_post) | **POST** /text-templates | Create text template + + +# **text_templates_get** +> TextTemplates text_templates_get(limit=limit, page=page) + +Fetch text templates list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.text_templates import TextTemplates +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TextTemplateApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch text templates list + api_response = await api_instance.text_templates_get(limit=limit, page=page) + print("The response of TextTemplateApi->text_templates_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TextTemplateApi->text_templates_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**TextTemplates**](TextTemplates.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **text_templates_id_delete** +> text_templates_id_delete(id) + +Delete text template + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TextTemplateApi(api_client) + id = 56 # int | ID of text template + + try: + # Delete text template + await api_instance.text_templates_id_delete(id) + except Exception as e: + print("Exception when calling TextTemplateApi->text_templates_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of text template | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **text_templates_id_get** +> TextTemplate text_templates_id_get(id) + +Fetch text template + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.text_template import TextTemplate +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TextTemplateApi(api_client) + id = 56 # int | ID of text template + + try: + # Fetch text template + api_response = await api_instance.text_templates_id_get(id) + print("The response of TextTemplateApi->text_templates_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TextTemplateApi->text_templates_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of text template | + +### Return type + +[**TextTemplate**](TextTemplate.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **text_templates_id_put** +> TextTemplate text_templates_id_put(id, body) + +Update text template + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.text_template import TextTemplate +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TextTemplateApi(api_client) + id = 56 # int | ID of text template + body = easybill_generated_sync.TextTemplate() # TextTemplate | + + try: + # Update text template + api_response = await api_instance.text_templates_id_put(id, body) + print("The response of TextTemplateApi->text_templates_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TextTemplateApi->text_templates_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of text template | + **body** | [**TextTemplate**](TextTemplate.md)| | + +### Return type + +[**TextTemplate**](TextTemplate.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid text template | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **text_templates_post** +> TextTemplate text_templates_post(body) + +Create text template + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.text_template import TextTemplate +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TextTemplateApi(api_client) + body = easybill_generated_sync.TextTemplate() # TextTemplate | + + try: + # Create text template + api_response = await api_instance.text_templates_post(body) + print("The response of TextTemplateApi->text_templates_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TextTemplateApi->text_templates_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**TextTemplate**](TextTemplate.md)| | + +### Return type + +[**TextTemplate**](TextTemplate.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/TextTemplates.md b/generated/sync/docs/TextTemplates.md new file mode 100644 index 0000000..4e933dd --- /dev/null +++ b/generated/sync/docs/TextTemplates.md @@ -0,0 +1,33 @@ +# TextTemplates + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[TextTemplate]**](TextTemplate.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.text_templates import TextTemplates + +# TODO update the JSON string below +json = "{}" +# create an instance of TextTemplates from a JSON string +text_templates_instance = TextTemplates.from_json(json) +# print the JSON string representation of the object +print(TextTemplates.to_json()) + +# convert the object into a dict +text_templates_dict = text_templates_instance.to_dict() +# create an instance of TextTemplates from a dict +text_templates_from_dict = TextTemplates.from_dict(text_templates_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/TimeTracking.md b/generated/sync/docs/TimeTracking.md new file mode 100644 index 0000000..f43f91c --- /dev/null +++ b/generated/sync/docs/TimeTracking.md @@ -0,0 +1,41 @@ +# TimeTracking + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cleared_at** | **datetime** | | [optional] +**created_at** | **datetime** | | [optional] [readonly] +**date_from_at** | **datetime** | | [optional] +**date_thru_at** | **datetime** | | [optional] +**description** | **str** | | +**hourly_rate** | **float** | Hourly rate in cents (e.g. \"150\" = 1.50€) | [optional] [default to 0.0] +**id** | **int** | | [optional] [readonly] +**note** | **str** | | [optional] [default to 'null'] +**number** | **str** | Can be chosen freely | [optional] +**position_id** | **int** | | [optional] +**project_id** | **int** | | [optional] +**login_id** | **int** | If omitted or null, the currently active login is used. | [optional] +**timer_value** | **int** | Tracked time in minutes | [optional] + +## Example + +```python +from easybill_generated_sync.models.time_tracking import TimeTracking + +# TODO update the JSON string below +json = "{}" +# create an instance of TimeTracking from a JSON string +time_tracking_instance = TimeTracking.from_json(json) +# print the JSON string representation of the object +print(TimeTracking.to_json()) + +# convert the object into a dict +time_tracking_dict = time_tracking_instance.to_dict() +# create an instance of TimeTracking from a dict +time_tracking_from_dict = TimeTracking.from_dict(time_tracking_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/TimeTrackingApi.md b/generated/sync/docs/TimeTrackingApi.md new file mode 100644 index 0000000..c5431b1 --- /dev/null +++ b/generated/sync/docs/TimeTrackingApi.md @@ -0,0 +1,450 @@ +# easybill_generated_sync.TimeTrackingApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**time_trackings_get**](TimeTrackingApi.md#time_trackings_get) | **GET** /time-trackings | Fetch time trackings list +[**time_trackings_id_delete**](TimeTrackingApi.md#time_trackings_id_delete) | **DELETE** /time-trackings/{id} | Delete time tracking +[**time_trackings_id_get**](TimeTrackingApi.md#time_trackings_id_get) | **GET** /time-trackings/{id} | Fetch time tracking +[**time_trackings_id_put**](TimeTrackingApi.md#time_trackings_id_put) | **PUT** /time-trackings/{id} | Update time tracking +[**time_trackings_post**](TimeTrackingApi.md#time_trackings_post) | **POST** /time-trackings | Create time tracking + + +# **time_trackings_get** +> TimeTrackings time_trackings_get(limit=limit, page=page, login_id=login_id, project_id=project_id, date_from_at=date_from_at, date_thru_at=date_thru_at) + +Fetch time trackings list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.time_trackings import TimeTrackings +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TimeTrackingApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + login_id = 'login_id_example' # str | Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id. (optional) + project_id = 'project_id_example' # str | Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id. (optional) + date_from_at = 'date_from_at_example' # str | Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. (optional) + date_thru_at = 'date_thru_at_example' # str | Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. (optional) + + try: + # Fetch time trackings list + api_response = await api_instance.time_trackings_get(limit=limit, page=page, login_id=login_id, project_id=project_id, date_from_at=date_from_at, date_thru_at=date_thru_at) + print("The response of TimeTrackingApi->time_trackings_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TimeTrackingApi->time_trackings_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + **login_id** | **str**| Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id. | [optional] + **project_id** | **str**| Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id. | [optional] + **date_from_at** | **str**| Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. | [optional] + **date_thru_at** | **str**| Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. | [optional] + +### Return type + +[**TimeTrackings**](TimeTrackings.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **time_trackings_id_delete** +> time_trackings_id_delete(id) + +Delete time tracking + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TimeTrackingApi(api_client) + id = 56 # int | ID of time tracking + + try: + # Delete time tracking + await api_instance.time_trackings_id_delete(id) + except Exception as e: + print("Exception when calling TimeTrackingApi->time_trackings_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of time tracking | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **time_trackings_id_get** +> TimeTracking time_trackings_id_get(id) + +Fetch time tracking + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.time_tracking import TimeTracking +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TimeTrackingApi(api_client) + id = 56 # int | ID of time tracking + + try: + # Fetch time tracking + api_response = await api_instance.time_trackings_id_get(id) + print("The response of TimeTrackingApi->time_trackings_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TimeTrackingApi->time_trackings_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of time tracking | + +### Return type + +[**TimeTracking**](TimeTracking.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **time_trackings_id_put** +> TimeTracking time_trackings_id_put(id, body) + +Update time tracking + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.time_tracking import TimeTracking +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TimeTrackingApi(api_client) + id = 56 # int | ID of time tracking + body = easybill_generated_sync.TimeTracking() # TimeTracking | + + try: + # Update time tracking + api_response = await api_instance.time_trackings_id_put(id, body) + print("The response of TimeTrackingApi->time_trackings_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TimeTrackingApi->time_trackings_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of time tracking | + **body** | [**TimeTracking**](TimeTracking.md)| | + +### Return type + +[**TimeTracking**](TimeTracking.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid time tracking | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **time_trackings_post** +> TimeTracking time_trackings_post(body) + +Create time tracking + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.time_tracking import TimeTracking +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.TimeTrackingApi(api_client) + body = easybill_generated_sync.TimeTracking() # TimeTracking | + + try: + # Create time tracking + api_response = await api_instance.time_trackings_post(body) + print("The response of TimeTrackingApi->time_trackings_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TimeTrackingApi->time_trackings_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**TimeTracking**](TimeTracking.md)| | + +### Return type + +[**TimeTracking**](TimeTracking.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/docs/TimeTrackings.md b/generated/sync/docs/TimeTrackings.md new file mode 100644 index 0000000..44b788f --- /dev/null +++ b/generated/sync/docs/TimeTrackings.md @@ -0,0 +1,33 @@ +# TimeTrackings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[TimeTracking]**](TimeTracking.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.time_trackings import TimeTrackings + +# TODO update the JSON string below +json = "{}" +# create an instance of TimeTrackings from a JSON string +time_trackings_instance = TimeTrackings.from_json(json) +# print the JSON string representation of the object +print(TimeTrackings.to_json()) + +# convert the object into a dict +time_trackings_dict = time_trackings_instance.to_dict() +# create an instance of TimeTrackings from a dict +time_trackings_from_dict = TimeTrackings.from_dict(time_trackings_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/WebHook.md b/generated/sync/docs/WebHook.md new file mode 100644 index 0000000..de22c7c --- /dev/null +++ b/generated/sync/docs/WebHook.md @@ -0,0 +1,36 @@ +# WebHook + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content_type** | **str** | | +**description** | **str** | | +**events** | **List[str]** | | +**id** | **int** | | [optional] [readonly] +**is_active** | **bool** | | [optional] [default to False] +**last_response** | [**WebHookLastResponse**](WebHookLastResponse.md) | | [optional] +**secret** | **str** | | +**url** | **str** | | + +## Example + +```python +from easybill_generated_sync.models.web_hook import WebHook + +# TODO update the JSON string below +json = "{}" +# create an instance of WebHook from a JSON string +web_hook_instance = WebHook.from_json(json) +# print the JSON string representation of the object +print(WebHook.to_json()) + +# convert the object into a dict +web_hook_dict = web_hook_instance.to_dict() +# create an instance of WebHook from a dict +web_hook_from_dict = WebHook.from_dict(web_hook_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/WebHookLastResponse.md b/generated/sync/docs/WebHookLastResponse.md new file mode 100644 index 0000000..7dbbd0f --- /dev/null +++ b/generated/sync/docs/WebHookLastResponse.md @@ -0,0 +1,31 @@ +# WebHookLastResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **datetime** | | [optional] [readonly] +**code** | **int** | | [optional] [readonly] +**response** | **str** | | [optional] [readonly] + +## Example + +```python +from easybill_generated_sync.models.web_hook_last_response import WebHookLastResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of WebHookLastResponse from a JSON string +web_hook_last_response_instance = WebHookLastResponse.from_json(json) +# print the JSON string representation of the object +print(WebHookLastResponse.to_json()) + +# convert the object into a dict +web_hook_last_response_dict = web_hook_last_response_instance.to_dict() +# create an instance of WebHookLastResponse from a dict +web_hook_last_response_from_dict = WebHookLastResponse.from_dict(web_hook_last_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/WebHooks.md b/generated/sync/docs/WebHooks.md new file mode 100644 index 0000000..2bfba28 --- /dev/null +++ b/generated/sync/docs/WebHooks.md @@ -0,0 +1,33 @@ +# WebHooks + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **int** | The current page | +**pages** | **int** | Max possible pages | +**limit** | **int** | Items limitation. Max 1000 | +**total** | **int** | Total Items | +**items** | [**List[WebHook]**](WebHook.md) | | [optional] + +## Example + +```python +from easybill_generated_sync.models.web_hooks import WebHooks + +# TODO update the JSON string below +json = "{}" +# create an instance of WebHooks from a JSON string +web_hooks_instance = WebHooks.from_json(json) +# print the JSON string representation of the object +print(WebHooks.to_json()) + +# convert the object into a dict +web_hooks_dict = web_hooks_instance.to_dict() +# create an instance of WebHooks from a dict +web_hooks_from_dict = WebHooks.from_dict(web_hooks_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/generated/sync/docs/WebhookApi.md b/generated/sync/docs/WebhookApi.md new file mode 100644 index 0000000..d3d0f45 --- /dev/null +++ b/generated/sync/docs/WebhookApi.md @@ -0,0 +1,442 @@ +# easybill_generated_sync.WebhookApi + +All URIs are relative to *https://api.easybill.de/rest/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**webhooks_get**](WebhookApi.md#webhooks_get) | **GET** /webhooks | Fetch WebHooks list +[**webhooks_id_delete**](WebhookApi.md#webhooks_id_delete) | **DELETE** /webhooks/{id} | Delete WebHook +[**webhooks_id_get**](WebhookApi.md#webhooks_id_get) | **GET** /webhooks/{id} | Fetch WebHook +[**webhooks_id_put**](WebhookApi.md#webhooks_id_put) | **PUT** /webhooks/{id} | Update WebHook +[**webhooks_post**](WebhookApi.md#webhooks_post) | **POST** /webhooks | Create WebHook + + +# **webhooks_get** +> WebHooks webhooks_get(limit=limit, page=page) + +Fetch WebHooks list + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.web_hooks import WebHooks +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.WebhookApi(api_client) + limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional) + page = 56 # int | Set current Page. Default is 1. (optional) + + try: + # Fetch WebHooks list + api_response = await api_instance.webhooks_get(limit=limit, page=page) + print("The response of WebhookApi->webhooks_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebhookApi->webhooks_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional] + **page** | **int**| Set current Page. Default is 1. | [optional] + +### Return type + +[**WebHooks**](WebHooks.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **webhooks_id_delete** +> webhooks_id_delete(id) + +Delete WebHook + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.WebhookApi(api_client) + id = 56 # int | ID of WebHook + + try: + # Delete WebHook + await api_instance.webhooks_id_delete(id) + except Exception as e: + print("Exception when calling WebhookApi->webhooks_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of WebHook | + +### Return type + +void (empty response body) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **webhooks_id_get** +> WebHook webhooks_id_get(id) + +Fetch WebHook + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.web_hook import WebHook +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.WebhookApi(api_client) + id = 56 # int | ID of WebHook + + try: + # Fetch WebHook + api_response = await api_instance.webhooks_id_get(id) + print("The response of WebhookApi->webhooks_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebhookApi->webhooks_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of WebHook | + +### Return type + +[**WebHook**](WebHook.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **webhooks_id_put** +> WebHook webhooks_id_put(id, body) + +Update WebHook + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.web_hook import WebHook +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.WebhookApi(api_client) + id = 56 # int | ID of WebHook + body = easybill_generated_sync.WebHook() # WebHook | + + try: + # Update WebHook + api_response = await api_instance.webhooks_id_put(id, body) + print("The response of WebhookApi->webhooks_id_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebhookApi->webhooks_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **int**| ID of WebHook | + **body** | [**WebHook**](WebHook.md)| | + +### Return type + +[**WebHook**](WebHook.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**404** | Not found | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **webhooks_post** +> WebHook webhooks_post(body) + +Create WebHook + +### Example + +* Basic Authentication (basicAuth): +* Api Key Authentication (Bearer): + +```python +import easybill_generated_sync +from easybill_generated_sync.models.web_hook import WebHook +from easybill_generated_sync.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.easybill.de/rest/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = easybill_generated_sync.Configuration( + host = "https://api.easybill.de/rest/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = easybill_generated_sync.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Configure API key authorization: Bearer +configuration.api_key['Bearer'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['Bearer'] = 'Bearer' + +# Enter a context with an instance of the API client +async with easybill_generated_sync.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = easybill_generated_sync.WebhookApi(api_client) + body = easybill_generated_sync.WebHook() # WebHook | + + try: + # Create WebHook + api_response = await api_instance.webhooks_post(body) + print("The response of WebhookApi->webhooks_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WebhookApi->webhooks_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**WebHook**](WebHook.md)| | + +### Return type + +[**WebHook**](WebHook.md) + +### Authorization + +[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Successful operation | - | +**429** | Too Many Requests | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/generated/sync/easybill_generated_sync/__init__.py b/generated/sync/easybill_generated_sync/__init__.py new file mode 100644 index 0000000..8e5aad0 --- /dev/null +++ b/generated/sync/easybill_generated_sync/__init__.py @@ -0,0 +1,208 @@ +# coding: utf-8 + +# flake8: noqa + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "1.0.0" + +# Define package exports +__all__ = [ + "AttachmentApi", + "ContactApi", + "CustomerApi", + "CustomerGroupApi", + "DiscountApi", + "DocumentApi", + "DocumentPaymentApi", + "DocumentVersionApi", + "LoginsApi", + "PdfTemplatesApi", + "PositionApi", + "PositionGroupApi", + "PostBoxApi", + "ProjectApi", + "SepaPaymentApi", + "SerialNumberApi", + "StockApi", + "TaskApi", + "TextTemplateApi", + "TimeTrackingApi", + "WebhookApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "AdvancedDataField", + "Attachment", + "Attachments", + "Contact", + "Contacts", + "Customer", + "CustomerGroup", + "CustomerGroups", + "CustomerSnapshot", + "Customers", + "Discount", + "DiscountPosition", + "DiscountPositionGroup", + "DiscountPositionGroups", + "DiscountPositions", + "Document", + "DocumentAddress", + "DocumentPayment", + "DocumentPayments", + "DocumentPosition", + "DocumentRecurring", + "DocumentVersion", + "DocumentVersionItem", + "DocumentVersions", + "Documents", + "FileFormatConfig", + "List", + "Login", + "LoginSecurity", + "Logins", + "PDFTemplate", + "PDFTemplateSettings", + "PDFTemplateSettingsEmail", + "PDFTemplates", + "Position", + "PositionExportIdentifierExtended", + "PositionGroup", + "PositionGroups", + "Positions", + "PostBox", + "PostBoxRequest", + "PostBoxes", + "Project", + "Projects", + "SEPAPayment", + "SEPAPayments", + "SerialNumber", + "SerialNumbers", + "ServiceDate", + "Stock", + "Stocks", + "Task", + "Tasks", + "TextTemplate", + "TextTemplates", + "TimeTracking", + "TimeTrackings", + "WebHook", + "WebHookLastResponse", + "WebHooks", +] + +# import apis into sdk package +from easybill_generated_sync.api.attachment_api import AttachmentApi as AttachmentApi +from easybill_generated_sync.api.contact_api import ContactApi as ContactApi +from easybill_generated_sync.api.customer_api import CustomerApi as CustomerApi +from easybill_generated_sync.api.customer_group_api import CustomerGroupApi as CustomerGroupApi +from easybill_generated_sync.api.discount_api import DiscountApi as DiscountApi +from easybill_generated_sync.api.document_api import DocumentApi as DocumentApi +from easybill_generated_sync.api.document_payment_api import DocumentPaymentApi as DocumentPaymentApi +from easybill_generated_sync.api.document_version_api import DocumentVersionApi as DocumentVersionApi +from easybill_generated_sync.api.logins_api import LoginsApi as LoginsApi +from easybill_generated_sync.api.pdf_templates_api import PdfTemplatesApi as PdfTemplatesApi +from easybill_generated_sync.api.position_api import PositionApi as PositionApi +from easybill_generated_sync.api.position_group_api import PositionGroupApi as PositionGroupApi +from easybill_generated_sync.api.post_box_api import PostBoxApi as PostBoxApi +from easybill_generated_sync.api.project_api import ProjectApi as ProjectApi +from easybill_generated_sync.api.sepa_payment_api import SepaPaymentApi as SepaPaymentApi +from easybill_generated_sync.api.serial_number_api import SerialNumberApi as SerialNumberApi +from easybill_generated_sync.api.stock_api import StockApi as StockApi +from easybill_generated_sync.api.task_api import TaskApi as TaskApi +from easybill_generated_sync.api.text_template_api import TextTemplateApi as TextTemplateApi +from easybill_generated_sync.api.time_tracking_api import TimeTrackingApi as TimeTrackingApi +from easybill_generated_sync.api.webhook_api import WebhookApi as WebhookApi + +# import ApiClient +from easybill_generated_sync.api_response import ApiResponse as ApiResponse +from easybill_generated_sync.api_client import ApiClient as ApiClient +from easybill_generated_sync.configuration import Configuration as Configuration +from easybill_generated_sync.exceptions import OpenApiException as OpenApiException +from easybill_generated_sync.exceptions import ApiTypeError as ApiTypeError +from easybill_generated_sync.exceptions import ApiValueError as ApiValueError +from easybill_generated_sync.exceptions import ApiKeyError as ApiKeyError +from easybill_generated_sync.exceptions import ApiAttributeError as ApiAttributeError +from easybill_generated_sync.exceptions import ApiException as ApiException + +# import models into sdk package +from easybill_generated_sync.models.advanced_data_field import AdvancedDataField as AdvancedDataField +from easybill_generated_sync.models.attachment import Attachment as Attachment +from easybill_generated_sync.models.attachments import Attachments as Attachments +from easybill_generated_sync.models.contact import Contact as Contact +from easybill_generated_sync.models.contacts import Contacts as Contacts +from easybill_generated_sync.models.customer import Customer as Customer +from easybill_generated_sync.models.customer_group import CustomerGroup as CustomerGroup +from easybill_generated_sync.models.customer_groups import CustomerGroups as CustomerGroups +from easybill_generated_sync.models.customer_snapshot import CustomerSnapshot as CustomerSnapshot +from easybill_generated_sync.models.customers import Customers as Customers +from easybill_generated_sync.models.discount import Discount as Discount +from easybill_generated_sync.models.discount_position import DiscountPosition as DiscountPosition +from easybill_generated_sync.models.discount_position_group import DiscountPositionGroup as DiscountPositionGroup +from easybill_generated_sync.models.discount_position_groups import DiscountPositionGroups as DiscountPositionGroups +from easybill_generated_sync.models.discount_positions import DiscountPositions as DiscountPositions +from easybill_generated_sync.models.document import Document as Document +from easybill_generated_sync.models.document_address import DocumentAddress as DocumentAddress +from easybill_generated_sync.models.document_payment import DocumentPayment as DocumentPayment +from easybill_generated_sync.models.document_payments import DocumentPayments as DocumentPayments +from easybill_generated_sync.models.document_position import DocumentPosition as DocumentPosition +from easybill_generated_sync.models.document_recurring import DocumentRecurring as DocumentRecurring +from easybill_generated_sync.models.document_version import DocumentVersion as DocumentVersion +from easybill_generated_sync.models.document_version_item import DocumentVersionItem as DocumentVersionItem +from easybill_generated_sync.models.document_versions import DocumentVersions as DocumentVersions +from easybill_generated_sync.models.documents import Documents as Documents +from easybill_generated_sync.models.file_format_config import FileFormatConfig as FileFormatConfig +from easybill_generated_sync.models.list import List as List +from easybill_generated_sync.models.login import Login as Login +from easybill_generated_sync.models.login_security import LoginSecurity as LoginSecurity +from easybill_generated_sync.models.logins import Logins as Logins +from easybill_generated_sync.models.pdf_template import PDFTemplate as PDFTemplate +from easybill_generated_sync.models.pdf_template_settings import PDFTemplateSettings as PDFTemplateSettings +from easybill_generated_sync.models.pdf_template_settings_email import PDFTemplateSettingsEmail as PDFTemplateSettingsEmail +from easybill_generated_sync.models.pdf_templates import PDFTemplates as PDFTemplates +from easybill_generated_sync.models.position import Position as Position +from easybill_generated_sync.models.position_export_identifier_extended import PositionExportIdentifierExtended as PositionExportIdentifierExtended +from easybill_generated_sync.models.position_group import PositionGroup as PositionGroup +from easybill_generated_sync.models.position_groups import PositionGroups as PositionGroups +from easybill_generated_sync.models.positions import Positions as Positions +from easybill_generated_sync.models.post_box import PostBox as PostBox +from easybill_generated_sync.models.post_box_request import PostBoxRequest as PostBoxRequest +from easybill_generated_sync.models.post_boxes import PostBoxes as PostBoxes +from easybill_generated_sync.models.project import Project as Project +from easybill_generated_sync.models.projects import Projects as Projects +from easybill_generated_sync.models.sepa_payment import SEPAPayment as SEPAPayment +from easybill_generated_sync.models.sepa_payments import SEPAPayments as SEPAPayments +from easybill_generated_sync.models.serial_number import SerialNumber as SerialNumber +from easybill_generated_sync.models.serial_numbers import SerialNumbers as SerialNumbers +from easybill_generated_sync.models.service_date import ServiceDate as ServiceDate +from easybill_generated_sync.models.stock import Stock as Stock +from easybill_generated_sync.models.stocks import Stocks as Stocks +from easybill_generated_sync.models.task import Task as Task +from easybill_generated_sync.models.tasks import Tasks as Tasks +from easybill_generated_sync.models.text_template import TextTemplate as TextTemplate +from easybill_generated_sync.models.text_templates import TextTemplates as TextTemplates +from easybill_generated_sync.models.time_tracking import TimeTracking as TimeTracking +from easybill_generated_sync.models.time_trackings import TimeTrackings as TimeTrackings +from easybill_generated_sync.models.web_hook import WebHook as WebHook +from easybill_generated_sync.models.web_hook_last_response import WebHookLastResponse as WebHookLastResponse +from easybill_generated_sync.models.web_hooks import WebHooks as WebHooks + diff --git a/generated/sync/easybill_generated_sync/api/__init__.py b/generated/sync/easybill_generated_sync/api/__init__.py new file mode 100644 index 0000000..e1c4e2f --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/__init__.py @@ -0,0 +1,25 @@ +# flake8: noqa + +# import apis into api package +from easybill_generated_sync.api.attachment_api import AttachmentApi +from easybill_generated_sync.api.contact_api import ContactApi +from easybill_generated_sync.api.customer_api import CustomerApi +from easybill_generated_sync.api.customer_group_api import CustomerGroupApi +from easybill_generated_sync.api.discount_api import DiscountApi +from easybill_generated_sync.api.document_api import DocumentApi +from easybill_generated_sync.api.document_payment_api import DocumentPaymentApi +from easybill_generated_sync.api.document_version_api import DocumentVersionApi +from easybill_generated_sync.api.logins_api import LoginsApi +from easybill_generated_sync.api.pdf_templates_api import PdfTemplatesApi +from easybill_generated_sync.api.position_api import PositionApi +from easybill_generated_sync.api.position_group_api import PositionGroupApi +from easybill_generated_sync.api.post_box_api import PostBoxApi +from easybill_generated_sync.api.project_api import ProjectApi +from easybill_generated_sync.api.sepa_payment_api import SepaPaymentApi +from easybill_generated_sync.api.serial_number_api import SerialNumberApi +from easybill_generated_sync.api.stock_api import StockApi +from easybill_generated_sync.api.task_api import TaskApi +from easybill_generated_sync.api.text_template_api import TextTemplateApi +from easybill_generated_sync.api.time_tracking_api import TimeTrackingApi +from easybill_generated_sync.api.webhook_api import WebhookApi + diff --git a/generated/sync/easybill_generated_sync/api/attachment_api.py b/generated/sync/easybill_generated_sync/api/attachment_api.py new file mode 100644 index 0000000..ffeb8c5 --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/attachment_api.py @@ -0,0 +1,1673 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBytes, StrictInt, StrictStr +from typing import Optional, Tuple, Union +from typing_extensions import Annotated +from easybill_generated_sync.models.attachment import Attachment +from easybill_generated_sync.models.attachments import Attachments + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class AttachmentApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def attachments_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Attachments: + """Fetch attachments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachments", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def attachments_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Attachments]: + """Fetch attachments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachments", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def attachments_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch attachments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachments", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _attachments_get_serialize( + self, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/attachments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def attachments_id_content_get( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Fetch attachment content + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_content_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def attachments_id_content_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Fetch attachment content + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_content_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def attachments_id_content_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch attachment content + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_content_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _attachments_id_content_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/attachments/{id}/content', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def attachments_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete attachment + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def attachments_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete attachment + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def attachments_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete attachment + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _attachments_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/attachments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def attachments_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Attachment: + """Fetch attachment + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def attachments_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Attachment]: + """Fetch attachment + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def attachments_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch attachment + + + :param id: ID of attachment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _attachments_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/attachments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def attachments_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + body: Attachment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Attachment: + """Update attachment + + + :param id: ID of attachment (required) + :type id: int + :param body: (required) + :type body: Attachment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachment", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def attachments_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + body: Attachment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Attachment]: + """Update attachment + + + :param id: ID of attachment (required) + :type id: int + :param body: (required) + :type body: Attachment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachment", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def attachments_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of attachment")], + body: Attachment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update attachment + + + :param id: ID of attachment (required) + :type id: int + :param body: (required) + :type body: Attachment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attachment", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _attachments_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/attachments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def attachments_post( + self, + file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Attachment: + """Create attachment + + + :param file: (required) + :type file: bytes + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_post_serialize( + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Attachment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def attachments_post_with_http_info( + self, + file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Attachment]: + """Create attachment + + + :param file: (required) + :type file: bytes + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_post_serialize( + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Attachment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def attachments_post_without_preload_content( + self, + file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create attachment + + + :param file: (required) + :type file: bytes + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._attachments_post_serialize( + file=file, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Attachment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _attachments_post_serialize( + self, + file, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + if file is not None: + _files['file'] = file + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/attachments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/contact_api.py b/generated/sync/easybill_generated_sync/api/contact_api.py new file mode 100644 index 0000000..f6b591a --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/contact_api.py @@ -0,0 +1,1489 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.contact import Contact +from easybill_generated_sync.models.contacts import Contacts + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class ContactApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def customers_customer_id_contacts_get( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer that needs to be fetched")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Contacts: + """Fetch customer contact list + + + :param customer_id: ID of customer that needs to be fetched (required) + :type customer_id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_get_serialize( + customer_id=customer_id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contacts", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_customer_id_contacts_get_with_http_info( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer that needs to be fetched")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Contacts]: + """Fetch customer contact list + + + :param customer_id: ID of customer that needs to be fetched (required) + :type customer_id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_get_serialize( + customer_id=customer_id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contacts", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_customer_id_contacts_get_without_preload_content( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer that needs to be fetched")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch customer contact list + + + :param customer_id: ID of customer that needs to be fetched (required) + :type customer_id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_get_serialize( + customer_id=customer_id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contacts", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_customer_id_contacts_get_serialize( + self, + customer_id, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if customer_id is not None: + _path_params['customerId'] = customer_id + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/customers/{customerId}/contacts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_customer_id_contacts_id_delete( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_delete_serialize( + customer_id=customer_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_customer_id_contacts_id_delete_with_http_info( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_delete_serialize( + customer_id=customer_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_customer_id_contacts_id_delete_without_preload_content( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_delete_serialize( + customer_id=customer_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_customer_id_contacts_id_delete_serialize( + self, + customer_id, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if customer_id is not None: + _path_params['customerId'] = customer_id + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/customers/{customerId}/contacts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_customer_id_contacts_id_get( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Contact: + """Fetch contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_get_serialize( + customer_id=customer_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_customer_id_contacts_id_get_with_http_info( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Contact]: + """Fetch contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_get_serialize( + customer_id=customer_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_customer_id_contacts_id_get_without_preload_content( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_get_serialize( + customer_id=customer_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_customer_id_contacts_id_get_serialize( + self, + customer_id, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if customer_id is not None: + _path_params['customerId'] = customer_id + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/customers/{customerId}/contacts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_customer_id_contacts_id_put( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + body: Optional[Contact] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Contact: + """Update Contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param body: + :type body: Contact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_put_serialize( + customer_id=customer_id, + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_customer_id_contacts_id_put_with_http_info( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + body: Optional[Contact] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Contact]: + """Update Contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param body: + :type body: Contact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_put_serialize( + customer_id=customer_id, + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_customer_id_contacts_id_put_without_preload_content( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + id: Annotated[StrictInt, Field(description="ID of contact")], + body: Optional[Contact] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param id: ID of contact (required) + :type id: int + :param body: + :type body: Contact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_id_put_serialize( + customer_id=customer_id, + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_customer_id_contacts_id_put_serialize( + self, + customer_id, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if customer_id is not None: + _path_params['customerId'] = customer_id + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/customers/{customerId}/contacts/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_customer_id_contacts_post( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + body: Optional[Contact] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Contact: + """Create new contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param body: + :type body: Contact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_post_serialize( + customer_id=customer_id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_customer_id_contacts_post_with_http_info( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + body: Optional[Contact] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Contact]: + """Create new contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param body: + :type body: Contact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_post_serialize( + customer_id=customer_id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_customer_id_contacts_post_without_preload_content( + self, + customer_id: Annotated[StrictInt, Field(description="ID of customer")], + body: Optional[Contact] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create new contact + + + :param customer_id: ID of customer (required) + :type customer_id: int + :param body: + :type body: Contact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_customer_id_contacts_post_serialize( + customer_id=customer_id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Contact", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_customer_id_contacts_post_serialize( + self, + customer_id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if customer_id is not None: + _path_params['customerId'] = customer_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/customers/{customerId}/contacts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/customer_api.py b/generated/sync/easybill_generated_sync/api/customer_api.py new file mode 100644 index 0000000..cf77eac --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/customer_api.py @@ -0,0 +1,1618 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.customer import Customer +from easybill_generated_sync.models.customers import Customers + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class CustomerApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def customers_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + group_id: Annotated[Optional[StrictStr], Field(description="Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id.")] = None, + additional_group_id: Annotated[Optional[StrictStr], Field(description="Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter customers by number. You can add multiple numbers separate by comma like no,no,no.")] = None, + country: Annotated[Optional[StrictStr], Field(description="Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR.")] = None, + zip_code: Annotated[Optional[StrictStr], Field(description="Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip.")] = None, + emails: Annotated[Optional[StrictStr], Field(description="Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail.")] = None, + first_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + last_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + company_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + created_at: Annotated[Optional[StrictStr], Field(description="Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Customers: + """Fetch customers list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param group_id: Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id. + :type group_id: str + :param additional_group_id: Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id. + :type additional_group_id: str + :param number: Filter customers by number. You can add multiple numbers separate by comma like no,no,no. + :type number: str + :param country: Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR. + :type country: str + :param zip_code: Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip. + :type zip_code: str + :param emails: Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail. + :type emails: str + :param first_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type first_name: str + :param last_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type last_name: str + :param company_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type company_name: str + :param created_at: Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type created_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_get_serialize( + limit=limit, + page=page, + group_id=group_id, + additional_group_id=additional_group_id, + number=number, + country=country, + zip_code=zip_code, + emails=emails, + first_name=first_name, + last_name=last_name, + company_name=company_name, + created_at=created_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customers", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + group_id: Annotated[Optional[StrictStr], Field(description="Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id.")] = None, + additional_group_id: Annotated[Optional[StrictStr], Field(description="Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter customers by number. You can add multiple numbers separate by comma like no,no,no.")] = None, + country: Annotated[Optional[StrictStr], Field(description="Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR.")] = None, + zip_code: Annotated[Optional[StrictStr], Field(description="Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip.")] = None, + emails: Annotated[Optional[StrictStr], Field(description="Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail.")] = None, + first_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + last_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + company_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + created_at: Annotated[Optional[StrictStr], Field(description="Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Customers]: + """Fetch customers list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param group_id: Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id. + :type group_id: str + :param additional_group_id: Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id. + :type additional_group_id: str + :param number: Filter customers by number. You can add multiple numbers separate by comma like no,no,no. + :type number: str + :param country: Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR. + :type country: str + :param zip_code: Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip. + :type zip_code: str + :param emails: Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail. + :type emails: str + :param first_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type first_name: str + :param last_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type last_name: str + :param company_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type company_name: str + :param created_at: Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type created_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_get_serialize( + limit=limit, + page=page, + group_id=group_id, + additional_group_id=additional_group_id, + number=number, + country=country, + zip_code=zip_code, + emails=emails, + first_name=first_name, + last_name=last_name, + company_name=company_name, + created_at=created_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customers", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + group_id: Annotated[Optional[StrictStr], Field(description="Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id.")] = None, + additional_group_id: Annotated[Optional[StrictStr], Field(description="Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter customers by number. You can add multiple numbers separate by comma like no,no,no.")] = None, + country: Annotated[Optional[StrictStr], Field(description="Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR.")] = None, + zip_code: Annotated[Optional[StrictStr], Field(description="Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip.")] = None, + emails: Annotated[Optional[StrictStr], Field(description="Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail.")] = None, + first_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + last_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + company_name: Annotated[Optional[StrictStr], Field(description="Filter customers by first_name. You can add multiple names separate by comma like name,name,name.")] = None, + created_at: Annotated[Optional[StrictStr], Field(description="Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch customers list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param group_id: Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id. + :type group_id: str + :param additional_group_id: Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id. + :type additional_group_id: str + :param number: Filter customers by number. You can add multiple numbers separate by comma like no,no,no. + :type number: str + :param country: Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR. + :type country: str + :param zip_code: Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip. + :type zip_code: str + :param emails: Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail. + :type emails: str + :param first_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type first_name: str + :param last_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type last_name: str + :param company_name: Filter customers by first_name. You can add multiple names separate by comma like name,name,name. + :type company_name: str + :param created_at: Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type created_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_get_serialize( + limit=limit, + page=page, + group_id=group_id, + additional_group_id=additional_group_id, + number=number, + country=country, + zip_code=zip_code, + emails=emails, + first_name=first_name, + last_name=last_name, + company_name=company_name, + created_at=created_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customers", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_get_serialize( + self, + limit, + page, + group_id, + additional_group_id, + number, + country, + zip_code, + emails, + first_name, + last_name, + company_name, + created_at, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if group_id is not None: + + _query_params.append(('group_id', group_id)) + + if additional_group_id is not None: + + _query_params.append(('additional_group_id', additional_group_id)) + + if number is not None: + + _query_params.append(('number', number)) + + if country is not None: + + _query_params.append(('country', country)) + + if zip_code is not None: + + _query_params.append(('zip_code', zip_code)) + + if emails is not None: + + _query_params.append(('emails', emails)) + + if first_name is not None: + + _query_params.append(('first_name', first_name)) + + if last_name is not None: + + _query_params.append(('last_name', last_name)) + + if company_name is not None: + + _query_params.append(('company_name', company_name)) + + if created_at is not None: + + _query_params.append(('created_at', created_at)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/customers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete customer + + + :param id: ID of customer that needs to be deleted (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete customer + + + :param id: ID of customer that needs to be deleted (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete customer + + + :param id: ID of customer that needs to be deleted (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/customers/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Customer: + """Fetch customer + + + :param id: ID of customer that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customer", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Customer]: + """Fetch customer + + + :param id: ID of customer that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customer", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch customer + + + :param id: ID of customer that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customer", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/customers/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be updated")], + body: Customer, + type: Annotated[Optional[StrictStr], Field(description="Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Customer: + """Update Customer + + + :param id: ID of customer that needs to be updated (required) + :type id: int + :param body: (required) + :type body: Customer + :param type: Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_put_serialize( + id=id, + body=body, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customer", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be updated")], + body: Customer, + type: Annotated[Optional[StrictStr], Field(description="Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Customer]: + """Update Customer + + + :param id: ID of customer that needs to be updated (required) + :type id: int + :param body: (required) + :type body: Customer + :param type: Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_put_serialize( + id=id, + body=body, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customer", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of customer that needs to be updated")], + body: Customer, + type: Annotated[Optional[StrictStr], Field(description="Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Customer + + + :param id: ID of customer that needs to be updated (required) + :type id: int + :param body: (required) + :type body: Customer + :param type: Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_id_put_serialize( + id=id, + body=body, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Customer", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_id_put_serialize( + self, + id, + body, + type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if type is not None: + + _query_params.append(('type', type)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/customers/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customers_post( + self, + body: Customer, + type: Annotated[Optional[StrictStr], Field(description="Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Customer: + """Create customer + + + :param body: (required) + :type body: Customer + :param type: Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_post_serialize( + body=body, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Customer", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customers_post_with_http_info( + self, + body: Customer, + type: Annotated[Optional[StrictStr], Field(description="Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Customer]: + """Create customer + + + :param body: (required) + :type body: Customer + :param type: Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_post_serialize( + body=body, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Customer", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customers_post_without_preload_content( + self, + body: Customer, + type: Annotated[Optional[StrictStr], Field(description="Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\".")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create customer + + + :param body: (required) + :type body: Customer + :param type: Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\". + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customers_post_serialize( + body=body, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Customer", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customers_post_serialize( + self, + body, + type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if type is not None: + + _query_params.append(('type', type)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/customers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/customer_group_api.py b/generated/sync/easybill_generated_sync/api/customer_group_api.py new file mode 100644 index 0000000..3a1eb60 --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/customer_group_api.py @@ -0,0 +1,1411 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.customer_group import CustomerGroup +from easybill_generated_sync.models.customer_groups import CustomerGroups + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class CustomerGroupApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def customer_groups_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CustomerGroups: + """Fetch customer group list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customer_groups_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CustomerGroups]: + """Fetch customer group list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customer_groups_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch customer group list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customer_groups_get_serialize( + self, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/customer-groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customer_groups_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of customer group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete customer group + + + :param id: ID of customer group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customer_groups_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of customer group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete customer group + + + :param id: ID of customer group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customer_groups_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of customer group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete customer group + + + :param id: ID of customer group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customer_groups_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/customer-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customer_groups_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of customer group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CustomerGroup: + """Fetch customer group + + + :param id: ID of customer group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customer_groups_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of customer group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CustomerGroup]: + """Fetch customer group + + + :param id: ID of customer group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customer_groups_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of customer group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch customer group + + + :param id: ID of customer group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customer_groups_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/customer-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customer_groups_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of customer goup")], + body: CustomerGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CustomerGroup: + """Update customer group + + + :param id: ID of customer goup (required) + :type id: int + :param body: (required) + :type body: CustomerGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroup", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customer_groups_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of customer goup")], + body: CustomerGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CustomerGroup]: + """Update customer group + + + :param id: ID of customer goup (required) + :type id: int + :param body: (required) + :type body: CustomerGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroup", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customer_groups_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of customer goup")], + body: CustomerGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update customer group + + + :param id: ID of customer goup (required) + :type id: int + :param body: (required) + :type body: CustomerGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomerGroup", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customer_groups_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/customer-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def customer_groups_post( + self, + body: CustomerGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CustomerGroup: + """Create customer group + + + :param body: (required) + :type body: CustomerGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CustomerGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def customer_groups_post_with_http_info( + self, + body: CustomerGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CustomerGroup]: + """Create customer group + + + :param body: (required) + :type body: CustomerGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CustomerGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def customer_groups_post_without_preload_content( + self, + body: CustomerGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create customer group + + + :param body: (required) + :type body: CustomerGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._customer_groups_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CustomerGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _customer_groups_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/customer-groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/discount_api.py b/generated/sync/easybill_generated_sync/api/discount_api.py new file mode 100644 index 0000000..46d25e8 --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/discount_api.py @@ -0,0 +1,2887 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.discount_position import DiscountPosition +from easybill_generated_sync.models.discount_position_group import DiscountPositionGroup +from easybill_generated_sync.models.discount_position_groups import DiscountPositionGroups +from easybill_generated_sync.models.discount_positions import DiscountPositions + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class DiscountApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def discounts_position_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPositions: + """Fetch list of position discounts + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. + :type customer_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPositions]: + """Fetch list of position discounts + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. + :type customer_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch list of position discounts + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. + :type customer_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_get_serialize( + self, + limit, + page, + customer_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if customer_id is not None: + + _query_params.append(('customer_id', customer_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/discounts/position', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_group_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPositionGroups: + """Fetch list of position-group discounts + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. + :type customer_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_group_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPositionGroups]: + """Fetch list of position-group discounts + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. + :type customer_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_group_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch list of position-group discounts + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id. + :type customer_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_group_get_serialize( + self, + limit, + page, + customer_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if customer_id is not None: + + _query_params.append(('customer_id', customer_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/discounts/position-group', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_group_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon deleted discount")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the specified position-group discount + + + :param id: ID of the to be soon deleted discount (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_group_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon deleted discount")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the specified position-group discount + + + :param id: ID of the to be soon deleted discount (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_group_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon deleted discount")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the specified position-group discount + + + :param id: ID of the to be soon deleted discount (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_group_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/discounts/position-group/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_group_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of the discount")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPositionGroup: + """Fetch specified position-group discount by id + + + :param id: ID of the discount (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_group_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the discount")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPositionGroup]: + """Fetch specified position-group discount by id + + + :param id: ID of the discount (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_group_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the discount")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch specified position-group discount by id + + + :param id: ID of the discount (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_group_id_get_serialize( + self, + id, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/discounts/position-group/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_group_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon updated discount")], + body: Optional[DiscountPositionGroup] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPositionGroup: + """Update a position-group discount + + + :param id: ID of the to be soon updated discount (required) + :type id: int + :param body: + :type body: DiscountPositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_group_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon updated discount")], + body: Optional[DiscountPositionGroup] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPositionGroup]: + """Update a position-group discount + + + :param id: ID of the to be soon updated discount (required) + :type id: int + :param body: + :type body: DiscountPositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_group_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon updated discount")], + body: Optional[DiscountPositionGroup] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a position-group discount + + + :param id: ID of the to be soon updated discount (required) + :type id: int + :param body: + :type body: DiscountPositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_group_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/discounts/position-group/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_group_post( + self, + body: DiscountPositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPositionGroup: + """Create a new position-group discount + + + :param body: (required) + :type body: DiscountPositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DiscountPositionGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_group_post_with_http_info( + self, + body: DiscountPositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPositionGroup]: + """Create a new position-group discount + + + :param body: (required) + :type body: DiscountPositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DiscountPositionGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_group_post_without_preload_content( + self, + body: DiscountPositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new position-group discount + + + :param body: (required) + :type body: DiscountPositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_group_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DiscountPositionGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_group_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/discounts/position-group', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon deleted discount")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the specified position discount + + + :param id: ID of the to be soon deleted discount (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon deleted discount")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the specified position discount + + + :param id: ID of the to be soon deleted discount (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon deleted discount")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the specified position discount + + + :param id: ID of the to be soon deleted discount (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/discounts/position/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of the discount")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPosition: + """Fetch specified position discount by id + + + :param id: ID of the discount (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPosition", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the discount")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPosition]: + """Fetch specified position discount by id + + + :param id: ID of the discount (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPosition", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the discount")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch specified position discount by id + + + :param id: ID of the discount (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPosition", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_id_get_serialize( + self, + id, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/discounts/position/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon updated discount")], + body: Optional[DiscountPosition] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPosition: + """Update a position discount + + + :param id: ID of the to be soon updated discount (required) + :type id: int + :param body: + :type body: DiscountPosition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPosition", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon updated discount")], + body: Optional[DiscountPosition] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPosition]: + """Update a position discount + + + :param id: ID of the to be soon updated discount (required) + :type id: int + :param body: + :type body: DiscountPosition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPosition", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the to be soon updated discount")], + body: Optional[DiscountPosition] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a position discount + + + :param id: ID of the to be soon updated discount (required) + :type id: int + :param body: + :type body: DiscountPosition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscountPosition", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/discounts/position/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def discounts_position_post( + self, + body: DiscountPosition, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscountPosition: + """Create a new position discount + + + :param body: (required) + :type body: DiscountPosition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DiscountPosition", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def discounts_position_post_with_http_info( + self, + body: DiscountPosition, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DiscountPosition]: + """Create a new position discount + + + :param body: (required) + :type body: DiscountPosition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DiscountPosition", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def discounts_position_post_without_preload_content( + self, + body: DiscountPosition, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new position discount + + + :param body: (required) + :type body: DiscountPosition + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._discounts_position_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DiscountPosition", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _discounts_position_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/discounts/position', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/document_api.py b/generated/sync/easybill_generated_sync/api/document_api.py new file mode 100644 index 0000000..363aeff --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/document_api.py @@ -0,0 +1,3740 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator +from typing import Optional, Tuple, Union +from typing_extensions import Annotated +from easybill_generated_sync.models.document import Document +from easybill_generated_sync.models.documents import Documents +from easybill_generated_sync.models.post_box_request import PostBoxRequest + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class DocumentApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def documents_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT.")] = None, + is_draft: Annotated[Optional[StrictStr], Field(description="Filter documents by draft flag.")] = None, + is_archive: Annotated[Optional[StrictStr], Field(description="Filter documents by archive flag.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id.")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id.")] = None, + ref_id: Annotated[Optional[StrictStr], Field(description="Filter documents by ref_id.")] = None, + document_date: Annotated[Optional[StrictStr], Field(description="Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + paid_at: Annotated[Optional[StrictStr], Field(description="Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents.")] = None, + title: Annotated[Optional[StrictStr], Field(description="Filter documents by title.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter documents by number.")] = None, + cancel_id: Annotated[Optional[StrictStr], Field(description="Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents.")] = None, + fulfillment_country: Annotated[Optional[StrictStr], Field(description="Filter documents by fulfillment_country.")] = None, + vat_country: Annotated[Optional[StrictStr], Field(description="Filter documents by vat_country.")] = None, + shipping_country: Annotated[Optional[StrictStr], Field(description="Filter documents by shipping_country.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter documents by status. Keep in mind that not every document type has a status.")] = None, + edited_at: Annotated[Optional[StrictStr], Field(description="Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Documents: + """Fetch documents list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT. + :type type: str + :param is_draft: Filter documents by draft flag. + :type is_draft: str + :param is_archive: Filter documents by archive flag. + :type is_archive: str + :param customer_id: Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id. + :type customer_id: str + :param project_id: Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id. + :type project_id: str + :param ref_id: Filter documents by ref_id. + :type ref_id: str + :param document_date: Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31. + :type document_date: str + :param paid_at: Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents. + :type paid_at: str + :param title: Filter documents by title. + :type title: str + :param number: Filter documents by number. + :type number: str + :param cancel_id: Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents. + :type cancel_id: str + :param fulfillment_country: Filter documents by fulfillment_country. + :type fulfillment_country: str + :param vat_country: Filter documents by vat_country. + :type vat_country: str + :param shipping_country: Filter documents by shipping_country. + :type shipping_country: str + :param status: Filter documents by status. Keep in mind that not every document type has a status. + :type status: str + :param edited_at: Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type edited_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_get_serialize( + limit=limit, + page=page, + type=type, + is_draft=is_draft, + is_archive=is_archive, + customer_id=customer_id, + project_id=project_id, + ref_id=ref_id, + document_date=document_date, + paid_at=paid_at, + title=title, + number=number, + cancel_id=cancel_id, + fulfillment_country=fulfillment_country, + vat_country=vat_country, + shipping_country=shipping_country, + status=status, + edited_at=edited_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Documents", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT.")] = None, + is_draft: Annotated[Optional[StrictStr], Field(description="Filter documents by draft flag.")] = None, + is_archive: Annotated[Optional[StrictStr], Field(description="Filter documents by archive flag.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id.")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id.")] = None, + ref_id: Annotated[Optional[StrictStr], Field(description="Filter documents by ref_id.")] = None, + document_date: Annotated[Optional[StrictStr], Field(description="Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + paid_at: Annotated[Optional[StrictStr], Field(description="Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents.")] = None, + title: Annotated[Optional[StrictStr], Field(description="Filter documents by title.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter documents by number.")] = None, + cancel_id: Annotated[Optional[StrictStr], Field(description="Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents.")] = None, + fulfillment_country: Annotated[Optional[StrictStr], Field(description="Filter documents by fulfillment_country.")] = None, + vat_country: Annotated[Optional[StrictStr], Field(description="Filter documents by vat_country.")] = None, + shipping_country: Annotated[Optional[StrictStr], Field(description="Filter documents by shipping_country.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter documents by status. Keep in mind that not every document type has a status.")] = None, + edited_at: Annotated[Optional[StrictStr], Field(description="Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Documents]: + """Fetch documents list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT. + :type type: str + :param is_draft: Filter documents by draft flag. + :type is_draft: str + :param is_archive: Filter documents by archive flag. + :type is_archive: str + :param customer_id: Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id. + :type customer_id: str + :param project_id: Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id. + :type project_id: str + :param ref_id: Filter documents by ref_id. + :type ref_id: str + :param document_date: Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31. + :type document_date: str + :param paid_at: Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents. + :type paid_at: str + :param title: Filter documents by title. + :type title: str + :param number: Filter documents by number. + :type number: str + :param cancel_id: Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents. + :type cancel_id: str + :param fulfillment_country: Filter documents by fulfillment_country. + :type fulfillment_country: str + :param vat_country: Filter documents by vat_country. + :type vat_country: str + :param shipping_country: Filter documents by shipping_country. + :type shipping_country: str + :param status: Filter documents by status. Keep in mind that not every document type has a status. + :type status: str + :param edited_at: Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type edited_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_get_serialize( + limit=limit, + page=page, + type=type, + is_draft=is_draft, + is_archive=is_archive, + customer_id=customer_id, + project_id=project_id, + ref_id=ref_id, + document_date=document_date, + paid_at=paid_at, + title=title, + number=number, + cancel_id=cancel_id, + fulfillment_country=fulfillment_country, + vat_country=vat_country, + shipping_country=shipping_country, + status=status, + edited_at=edited_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Documents", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT.")] = None, + is_draft: Annotated[Optional[StrictStr], Field(description="Filter documents by draft flag.")] = None, + is_archive: Annotated[Optional[StrictStr], Field(description="Filter documents by archive flag.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id.")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id.")] = None, + ref_id: Annotated[Optional[StrictStr], Field(description="Filter documents by ref_id.")] = None, + document_date: Annotated[Optional[StrictStr], Field(description="Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + paid_at: Annotated[Optional[StrictStr], Field(description="Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents.")] = None, + title: Annotated[Optional[StrictStr], Field(description="Filter documents by title.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter documents by number.")] = None, + cancel_id: Annotated[Optional[StrictStr], Field(description="Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents.")] = None, + fulfillment_country: Annotated[Optional[StrictStr], Field(description="Filter documents by fulfillment_country.")] = None, + vat_country: Annotated[Optional[StrictStr], Field(description="Filter documents by vat_country.")] = None, + shipping_country: Annotated[Optional[StrictStr], Field(description="Filter documents by shipping_country.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter documents by status. Keep in mind that not every document type has a status.")] = None, + edited_at: Annotated[Optional[StrictStr], Field(description="Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch documents list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT. + :type type: str + :param is_draft: Filter documents by draft flag. + :type is_draft: str + :param is_archive: Filter documents by archive flag. + :type is_archive: str + :param customer_id: Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id. + :type customer_id: str + :param project_id: Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id. + :type project_id: str + :param ref_id: Filter documents by ref_id. + :type ref_id: str + :param document_date: Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31. + :type document_date: str + :param paid_at: Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents. + :type paid_at: str + :param title: Filter documents by title. + :type title: str + :param number: Filter documents by number. + :type number: str + :param cancel_id: Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents. + :type cancel_id: str + :param fulfillment_country: Filter documents by fulfillment_country. + :type fulfillment_country: str + :param vat_country: Filter documents by vat_country. + :type vat_country: str + :param shipping_country: Filter documents by shipping_country. + :type shipping_country: str + :param status: Filter documents by status. Keep in mind that not every document type has a status. + :type status: str + :param edited_at: Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type edited_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_get_serialize( + limit=limit, + page=page, + type=type, + is_draft=is_draft, + is_archive=is_archive, + customer_id=customer_id, + project_id=project_id, + ref_id=ref_id, + document_date=document_date, + paid_at=paid_at, + title=title, + number=number, + cancel_id=cancel_id, + fulfillment_country=fulfillment_country, + vat_country=vat_country, + shipping_country=shipping_country, + status=status, + edited_at=edited_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Documents", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_get_serialize( + self, + limit, + page, + type, + is_draft, + is_archive, + customer_id, + project_id, + ref_id, + document_date, + paid_at, + title, + number, + cancel_id, + fulfillment_country, + vat_country, + shipping_country, + status, + edited_at, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if type is not None: + + _query_params.append(('type', type)) + + if is_draft is not None: + + _query_params.append(('is_draft', is_draft)) + + if is_archive is not None: + + _query_params.append(('is_archive', is_archive)) + + if customer_id is not None: + + _query_params.append(('customer_id', customer_id)) + + if project_id is not None: + + _query_params.append(('project_id', project_id)) + + if ref_id is not None: + + _query_params.append(('ref_id', ref_id)) + + if document_date is not None: + + _query_params.append(('document_date', document_date)) + + if paid_at is not None: + + _query_params.append(('paid_at', paid_at)) + + if title is not None: + + _query_params.append(('title', title)) + + if number is not None: + + _query_params.append(('number', number)) + + if cancel_id is not None: + + _query_params.append(('cancel_id', cancel_id)) + + if fulfillment_country is not None: + + _query_params.append(('fulfillment_country', fulfillment_country)) + + if vat_country is not None: + + _query_params.append(('vat_country', vat_country)) + + if shipping_country is not None: + + _query_params.append(('shipping_country', shipping_country)) + + if status is not None: + + _query_params.append(('status', status)) + + if edited_at is not None: + + _query_params.append(('edited_at', edited_at)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_cancel_post( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + use_text_from_template: Annotated[Optional[StrictBool], Field(description="Use standard texts from the template.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Document: + """Cancel document + + + :param id: ID of document (required) + :type id: int + :param use_text_from_template: Use standard texts from the template. + :type use_text_from_template: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_cancel_post_serialize( + id=id, + use_text_from_template=use_text_from_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_cancel_post_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + use_text_from_template: Annotated[Optional[StrictBool], Field(description="Use standard texts from the template.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Document]: + """Cancel document + + + :param id: ID of document (required) + :type id: int + :param use_text_from_template: Use standard texts from the template. + :type use_text_from_template: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_cancel_post_serialize( + id=id, + use_text_from_template=use_text_from_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_cancel_post_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + use_text_from_template: Annotated[Optional[StrictBool], Field(description="Use standard texts from the template.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Cancel document + + + :param id: ID of document (required) + :type id: int + :param use_text_from_template: Use standard texts from the template. + :type use_text_from_template: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_cancel_post_serialize( + id=id, + use_text_from_template=use_text_from_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_cancel_post_serialize( + self, + id, + use_text_from_template, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if use_text_from_template is not None: + + _query_params.append(('use_text_from_template', use_text_from_template)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/documents/{id}/cancel', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/documents/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_done_put( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + reason_for_change: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="A string that is saved on the document version as reason.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Document: + """To complete a document. + + + :param id: ID of document (required) + :type id: int + :param reason_for_change: A string that is saved on the document version as reason. + :type reason_for_change: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_done_put_serialize( + id=id, + reason_for_change=reason_for_change, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_done_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + reason_for_change: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="A string that is saved on the document version as reason.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Document]: + """To complete a document. + + + :param id: ID of document (required) + :type id: int + :param reason_for_change: A string that is saved on the document version as reason. + :type reason_for_change: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_done_put_serialize( + id=id, + reason_for_change=reason_for_change, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_done_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + reason_for_change: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="A string that is saved on the document version as reason.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """To complete a document. + + + :param id: ID of document (required) + :type id: int + :param reason_for_change: A string that is saved on the document version as reason. + :type reason_for_change: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_done_put_serialize( + id=id, + reason_for_change=reason_for_change, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_done_put_serialize( + self, + id, + reason_for_change, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if reason_for_change is not None: + + _query_params.append(('reason_for_change', reason_for_change)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/documents/{id}/done', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_download_get( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + accept: Annotated[Optional[StrictStr], Field(description="The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Fetch the document in best fitting format to the given Accept header + + + :param id: ID of document (required) + :type id: int + :param accept: The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher. + :type accept: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_download_get_serialize( + id=id, + accept=accept, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '406': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_download_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + accept: Annotated[Optional[StrictStr], Field(description="The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Fetch the document in best fitting format to the given Accept header + + + :param id: ID of document (required) + :type id: int + :param accept: The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher. + :type accept: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_download_get_serialize( + id=id, + accept=accept, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '406': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_download_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + accept: Annotated[Optional[StrictStr], Field(description="The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch the document in best fitting format to the given Accept header + + + :param id: ID of document (required) + :type id: int + :param accept: The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher. + :type accept: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_download_get_serialize( + id=id, + accept=accept, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '406': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_download_get_serialize( + self, + id, + accept, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + if accept is not None: + _header_params['Accept'] = accept + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/pdf', + 'application/pdf;format=zugferd;version=1.0.0', + 'application/pdf;format=zugferd;version=2.2.0', + 'application/xml;format=xrechnung;version=2.3.0', + 'application/xml;format=xrechnung;version=3.0.1' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents/{id}/download', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Document: + """Fetch document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Document]: + """Fetch document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_jpg_get( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + offset: Annotated[Optional[StrictInt], Field(description="The page of the document where the image should start.")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The page of the document where the image should end.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Download a document as an jpeg-image + + + :param id: ID of document (required) + :type id: int + :param offset: The page of the document where the image should start. + :type offset: int + :param limit: The page of the document where the image should end. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_jpg_get_serialize( + id=id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_jpg_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + offset: Annotated[Optional[StrictInt], Field(description="The page of the document where the image should start.")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The page of the document where the image should end.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Download a document as an jpeg-image + + + :param id: ID of document (required) + :type id: int + :param offset: The page of the document where the image should start. + :type offset: int + :param limit: The page of the document where the image should end. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_jpg_get_serialize( + id=id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_jpg_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + offset: Annotated[Optional[StrictInt], Field(description="The page of the document where the image should start.")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The page of the document where the image should end.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Download a document as an jpeg-image + + + :param id: ID of document (required) + :type id: int + :param offset: The page of the document where the image should start. + :type offset: int + :param limit: The page of the document where the image should end. + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_jpg_get_serialize( + id=id, + offset=offset, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_jpg_get_serialize( + self, + id, + offset, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'image/jpeg' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents/{id}/jpg', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_pdf_get( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Fetch pdf document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_pdf_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_pdf_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Fetch pdf document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_pdf_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_pdf_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch pdf document + + + :param id: ID of document (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_pdf_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_pdf_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/pdf' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents/{id}/pdf', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + body: Document, + refresh_customer_data: Annotated[Optional[StrictBool], Field(description="Forces refreshing of the customer data.")] = None, + reason_for_change: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Document: + """Update document + + + :param id: ID of document (required) + :type id: int + :param body: (required) + :type body: Document + :param refresh_customer_data: Forces refreshing of the customer data. + :type refresh_customer_data: bool + :param reason_for_change: A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value. + :type reason_for_change: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_put_serialize( + id=id, + body=body, + refresh_customer_data=refresh_customer_data, + reason_for_change=reason_for_change, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '400': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + body: Document, + refresh_customer_data: Annotated[Optional[StrictBool], Field(description="Forces refreshing of the customer data.")] = None, + reason_for_change: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Document]: + """Update document + + + :param id: ID of document (required) + :type id: int + :param body: (required) + :type body: Document + :param refresh_customer_data: Forces refreshing of the customer data. + :type refresh_customer_data: bool + :param reason_for_change: A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value. + :type reason_for_change: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_put_serialize( + id=id, + body=body, + refresh_customer_data=refresh_customer_data, + reason_for_change=reason_for_change, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '400': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + body: Document, + refresh_customer_data: Annotated[Optional[StrictBool], Field(description="Forces refreshing of the customer data.")] = None, + reason_for_change: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]], Field(description="A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update document + + + :param id: ID of document (required) + :type id: int + :param body: (required) + :type body: Document + :param refresh_customer_data: Forces refreshing of the customer data. + :type refresh_customer_data: bool + :param reason_for_change: A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value. + :type reason_for_change: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_put_serialize( + id=id, + body=body, + refresh_customer_data=refresh_customer_data, + reason_for_change=reason_for_change, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Document", + '400': None, + '409': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_put_serialize( + self, + id, + body, + refresh_customer_data, + reason_for_change, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if refresh_customer_data is not None: + + _query_params.append(('refresh_customer_data', refresh_customer_data)) + + if reason_for_change is not None: + + _query_params.append(('reason_for_change', reason_for_change)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/documents/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_send_type_post( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + type: StrictStr, + body: PostBoxRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Send document + + + :param id: ID of document (required) + :type id: int + :param type: (required) + :type type: str + :param body: (required) + :type body: PostBoxRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_send_type_post_serialize( + id=id, + type=type, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_send_type_post_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + type: StrictStr, + body: PostBoxRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Send document + + + :param id: ID of document (required) + :type id: int + :param type: (required) + :type type: str + :param body: (required) + :type body: PostBoxRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_send_type_post_serialize( + id=id, + type=type, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_send_type_post_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + type: StrictStr, + body: PostBoxRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Send document + + + :param id: ID of document (required) + :type id: int + :param type: (required) + :type type: str + :param body: (required) + :type body: PostBoxRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_send_type_post_serialize( + id=id, + type=type, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_send_type_post_serialize( + self, + id, + type, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + if type is not None: + _path_params['type'] = type + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/documents/{id}/send/{type}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_type_post( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + type: Annotated[StrictStr, Field(description="The target document type")], + pdf_template: Annotated[Optional[StrictStr], Field(description="The ID of the printer template to use. Defaults to 'DE' if not given.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Document: + """Convert an existing document to one of a different type + + + :param id: ID of document (required) + :type id: int + :param type: The target document type (required) + :type type: str + :param pdf_template: The ID of the printer template to use. Defaults to 'DE' if not given. + :type pdf_template: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_type_post_serialize( + id=id, + type=type, + pdf_template=pdf_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Document", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_type_post_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + type: Annotated[StrictStr, Field(description="The target document type")], + pdf_template: Annotated[Optional[StrictStr], Field(description="The ID of the printer template to use. Defaults to 'DE' if not given.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Document]: + """Convert an existing document to one of a different type + + + :param id: ID of document (required) + :type id: int + :param type: The target document type (required) + :type type: str + :param pdf_template: The ID of the printer template to use. Defaults to 'DE' if not given. + :type pdf_template: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_type_post_serialize( + id=id, + type=type, + pdf_template=pdf_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Document", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_type_post_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + type: Annotated[StrictStr, Field(description="The target document type")], + pdf_template: Annotated[Optional[StrictStr], Field(description="The ID of the printer template to use. Defaults to 'DE' if not given.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Convert an existing document to one of a different type + + + :param id: ID of document (required) + :type id: int + :param type: The target document type (required) + :type type: str + :param pdf_template: The ID of the printer template to use. Defaults to 'DE' if not given. + :type pdf_template: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_type_post_serialize( + id=id, + type=type, + pdf_template=pdf_template, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Document", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_type_post_serialize( + self, + id, + type, + pdf_template, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + if type is not None: + _path_params['type'] = type + # process the query parameters + if pdf_template is not None: + + _query_params.append(('pdf_template', pdf_template)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/documents/{id}/{type}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_post( + self, + body: Document, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Document: + """Create document + + + :param body: (required) + :type body: Document + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Document", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_post_with_http_info( + self, + body: Document, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Document]: + """Create document + + + :param body: (required) + :type body: Document + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Document", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_post_without_preload_content( + self, + body: Document, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create document + + + :param body: (required) + :type body: Document + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Document", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/documents', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/document_payment_api.py b/generated/sync/easybill_generated_sync/api/document_payment_api.py new file mode 100644 index 0000000..084673f --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/document_payment_api.py @@ -0,0 +1,1186 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.document_payment import DocumentPayment +from easybill_generated_sync.models.document_payments import DocumentPayments + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class DocumentPaymentApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def document_payments_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter payments by document_id. You can add multiple ids separate by comma like id,id,id.")] = None, + payment_at: Annotated[Optional[StrictStr], Field(description="Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + reference: Annotated[Optional[StrictStr], Field(description="Filter payments by reference. You can add multiple references separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DocumentPayments: + """Fetch document payments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param document_id: Filter payments by document_id. You can add multiple ids separate by comma like id,id,id. + :type document_id: str + :param payment_at: Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type payment_at: str + :param reference: Filter payments by reference. You can add multiple references separate by comma like id,id,id. + :type reference: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_get_serialize( + limit=limit, + page=page, + document_id=document_id, + payment_at=payment_at, + reference=reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentPayments", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def document_payments_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter payments by document_id. You can add multiple ids separate by comma like id,id,id.")] = None, + payment_at: Annotated[Optional[StrictStr], Field(description="Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + reference: Annotated[Optional[StrictStr], Field(description="Filter payments by reference. You can add multiple references separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocumentPayments]: + """Fetch document payments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param document_id: Filter payments by document_id. You can add multiple ids separate by comma like id,id,id. + :type document_id: str + :param payment_at: Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type payment_at: str + :param reference: Filter payments by reference. You can add multiple references separate by comma like id,id,id. + :type reference: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_get_serialize( + limit=limit, + page=page, + document_id=document_id, + payment_at=payment_at, + reference=reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentPayments", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def document_payments_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter payments by document_id. You can add multiple ids separate by comma like id,id,id.")] = None, + payment_at: Annotated[Optional[StrictStr], Field(description="Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31.")] = None, + reference: Annotated[Optional[StrictStr], Field(description="Filter payments by reference. You can add multiple references separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch document payments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param document_id: Filter payments by document_id. You can add multiple ids separate by comma like id,id,id. + :type document_id: str + :param payment_at: Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31. + :type payment_at: str + :param reference: Filter payments by reference. You can add multiple references separate by comma like id,id,id. + :type reference: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_get_serialize( + limit=limit, + page=page, + document_id=document_id, + payment_at=payment_at, + reference=reference, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentPayments", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _document_payments_get_serialize( + self, + limit, + page, + document_id, + payment_at, + reference, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if document_id is not None: + + _query_params.append(('document_id', document_id)) + + if payment_at is not None: + + _query_params.append(('payment_at', payment_at)) + + if reference is not None: + + _query_params.append(('reference', reference)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/document-payments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def document_payments_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of document payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete document payment + + + :param id: ID of document payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def document_payments_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete document payment + + + :param id: ID of document payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def document_payments_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete document payment + + + :param id: ID of document payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _document_payments_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/document-payments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def document_payments_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of document payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DocumentPayment: + """Fetch document payment + + + :param id: ID of document payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentPayment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def document_payments_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocumentPayment]: + """Fetch document payment + + + :param id: ID of document payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentPayment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def document_payments_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch document payment + + + :param id: ID of document payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentPayment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _document_payments_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/document-payments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def document_payments_post( + self, + body: DocumentPayment, + paid: Annotated[Optional[StrictBool], Field(description="Mark document as paid when amount less then payment amount.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DocumentPayment: + """Create document payment + + + :param body: (required) + :type body: DocumentPayment + :param paid: Mark document as paid when amount less then payment amount. + :type paid: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_post_serialize( + body=body, + paid=paid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DocumentPayment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def document_payments_post_with_http_info( + self, + body: DocumentPayment, + paid: Annotated[Optional[StrictBool], Field(description="Mark document as paid when amount less then payment amount.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocumentPayment]: + """Create document payment + + + :param body: (required) + :type body: DocumentPayment + :param paid: Mark document as paid when amount less then payment amount. + :type paid: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_post_serialize( + body=body, + paid=paid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DocumentPayment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def document_payments_post_without_preload_content( + self, + body: DocumentPayment, + paid: Annotated[Optional[StrictBool], Field(description="Mark document as paid when amount less then payment amount.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create document payment + + + :param body: (required) + :type body: DocumentPayment + :param paid: Mark document as paid when amount less then payment amount. + :type paid: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._document_payments_post_serialize( + body=body, + paid=paid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "DocumentPayment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _document_payments_post_serialize( + self, + body, + paid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if paid is not None: + + _query_params.append(('paid', paid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/document-payments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/document_version_api.py b/generated/sync/easybill_generated_sync/api/document_version_api.py new file mode 100644 index 0000000..f1fb21e --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/document_version_api.py @@ -0,0 +1,911 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBytes, StrictInt, StrictStr +from typing import Optional, Tuple, Union +from typing_extensions import Annotated +from easybill_generated_sync.models.document_version import DocumentVersion +from easybill_generated_sync.models.document_versions import DocumentVersions + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class DocumentVersionApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def documents_id_versions_get( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DocumentVersions: + """List all versions of a given document + + + :param id: ID of document (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentVersions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_versions_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocumentVersions]: + """List all versions of a given document + + + :param id: ID of document (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentVersions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_versions_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all versions of a given document + + + :param id: ID of document (required) + :type id: int + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_get_serialize( + id=id, + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentVersions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_versions_get_serialize( + self, + id, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents/{id}/versions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_versions_version_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + version_id: Annotated[StrictInt, Field(description="ID of document version")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DocumentVersion: + """Show a single version of a given document + + + :param id: ID of document (required) + :type id: int + :param version_id: ID of document version (required) + :type version_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_version_id_get_serialize( + id=id, + version_id=version_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentVersion", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_versions_version_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + version_id: Annotated[StrictInt, Field(description="ID of document version")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocumentVersion]: + """Show a single version of a given document + + + :param id: ID of document (required) + :type id: int + :param version_id: ID of document version (required) + :type version_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_version_id_get_serialize( + id=id, + version_id=version_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentVersion", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_versions_version_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + version_id: Annotated[StrictInt, Field(description="ID of document version")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Show a single version of a given document + + + :param id: ID of document (required) + :type id: int + :param version_id: ID of document version (required) + :type version_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_version_id_get_serialize( + id=id, + version_id=version_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentVersion", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_versions_version_id_get_serialize( + self, + id, + version_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + if version_id is not None: + _path_params['versionId'] = version_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents/{id}/versions/{versionId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def documents_id_versions_version_id_items_version_item_id_download_get( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + version_id: Annotated[StrictInt, Field(description="ID of document version")], + version_item_id: Annotated[StrictInt, Field(description="ID of document version item")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Download a specific file for a single version of a given document + + + :param id: ID of document (required) + :type id: int + :param version_id: ID of document version (required) + :type version_id: int + :param version_item_id: ID of document version item (required) + :type version_item_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_version_id_items_version_item_id_download_get_serialize( + id=id, + version_id=version_id, + version_item_id=version_item_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def documents_id_versions_version_id_items_version_item_id_download_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + version_id: Annotated[StrictInt, Field(description="ID of document version")], + version_item_id: Annotated[StrictInt, Field(description="ID of document version item")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Download a specific file for a single version of a given document + + + :param id: ID of document (required) + :type id: int + :param version_id: ID of document version (required) + :type version_id: int + :param version_item_id: ID of document version item (required) + :type version_item_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_version_id_items_version_item_id_download_get_serialize( + id=id, + version_id=version_id, + version_item_id=version_item_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def documents_id_versions_version_id_items_version_item_id_download_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of document")], + version_id: Annotated[StrictInt, Field(description="ID of document version")], + version_item_id: Annotated[StrictInt, Field(description="ID of document version item")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Download a specific file for a single version of a given document + + + :param id: ID of document (required) + :type id: int + :param version_id: ID of document version (required) + :type version_id: int + :param version_item_id: ID of document version item (required) + :type version_item_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._documents_id_versions_version_id_items_version_item_id_download_get_serialize( + id=id, + version_id=version_id, + version_item_id=version_item_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _documents_id_versions_version_id_items_version_item_id_download_get_serialize( + self, + id, + version_id, + version_item_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + if version_id is not None: + _path_params['versionId'] = version_id + if version_item_id is not None: + _path_params['versionItemId'] = version_item_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/pdf', + 'text/xml' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/documents/{id}/versions/{versionId}/items/{versionItemId}/download', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/logins_api.py b/generated/sync/easybill_generated_sync/api/logins_api.py new file mode 100644 index 0000000..650af85 --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/logins_api.py @@ -0,0 +1,582 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.login import Login +from easybill_generated_sync.models.logins import Logins + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class LoginsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def logins_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Logins: + """logins_get + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logins_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Logins", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def logins_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Logins]: + """logins_get + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logins_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Logins", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def logins_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """logins_get + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logins_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Logins", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _logins_get_serialize( + self, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/logins', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def logins_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of the login that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Login: + """logins_id_get + + + :param id: ID of the login that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logins_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Login", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def logins_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the login that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Login]: + """logins_id_get + + + :param id: ID of the login that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logins_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Login", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def logins_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the login that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """logins_id_get + + + :param id: ID of the login that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._logins_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Login", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _logins_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/logins/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/pdf_templates_api.py b/generated/sync/easybill_generated_sync/api/pdf_templates_api.py new file mode 100644 index 0000000..07ba952 --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/pdf_templates_api.py @@ -0,0 +1,303 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.pdf_templates import PDFTemplates + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class PdfTemplatesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def pdf_templates_get( + self, + type: Annotated[Optional[List[StrictStr]], Field(description="Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PDFTemplates: + """Fetch PDF Templates list + + + :param type: Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type. + :type type: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pdf_templates_get_serialize( + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PDFTemplates", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def pdf_templates_get_with_http_info( + self, + type: Annotated[Optional[List[StrictStr]], Field(description="Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PDFTemplates]: + """Fetch PDF Templates list + + + :param type: Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type. + :type type: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pdf_templates_get_serialize( + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PDFTemplates", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def pdf_templates_get_without_preload_content( + self, + type: Annotated[Optional[List[StrictStr]], Field(description="Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch PDF Templates list + + + :param type: Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type. + :type type: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pdf_templates_get_serialize( + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PDFTemplates", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pdf_templates_get_serialize( + self, + type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'type': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if type is not None: + + _query_params.append(('type', type)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pdf-templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/position_api.py b/generated/sync/easybill_generated_sync/api/position_api.py new file mode 100644 index 0000000..0995439 --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/position_api.py @@ -0,0 +1,1445 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.position import Position +from easybill_generated_sync.models.positions import Positions + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class PositionApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def positions_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter positions by type.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter positions by number. You can add multiple numbers separate by comma like no,no,no.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Positions: + """Fetch positions list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter positions by type. + :type type: str + :param number: Filter positions by number. You can add multiple numbers separate by comma like no,no,no. + :type number: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_get_serialize( + limit=limit, + page=page, + type=type, + number=number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Positions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def positions_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter positions by type.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter positions by number. You can add multiple numbers separate by comma like no,no,no.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Positions]: + """Fetch positions list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter positions by type. + :type type: str + :param number: Filter positions by number. You can add multiple numbers separate by comma like no,no,no. + :type number: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_get_serialize( + limit=limit, + page=page, + type=type, + number=number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Positions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def positions_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter positions by type.")] = None, + number: Annotated[Optional[StrictStr], Field(description="Filter positions by number. You can add multiple numbers separate by comma like no,no,no.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch positions list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter positions by type. + :type type: str + :param number: Filter positions by number. You can add multiple numbers separate by comma like no,no,no. + :type number: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_get_serialize( + limit=limit, + page=page, + type=type, + number=number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Positions", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _positions_get_serialize( + self, + limit, + page, + type, + number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if type is not None: + + _query_params.append(('type', type)) + + if number is not None: + + _query_params.append(('number', number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/positions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def positions_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete position + + + :param id: ID of position (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def positions_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete position + + + :param id: ID of position (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def positions_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete position + + + :param id: ID of position (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _positions_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/positions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def positions_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Position: + """Fetch position + + + :param id: ID of position (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Position", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def positions_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Position]: + """Fetch position + + + :param id: ID of position (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Position", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def positions_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch position + + + :param id: ID of position (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Position", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _positions_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/positions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def positions_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + body: Position, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Position: + """Update position + + + :param id: ID of position (required) + :type id: int + :param body: (required) + :type body: Position + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Position", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def positions_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + body: Position, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Position]: + """Update position + + + :param id: ID of position (required) + :type id: int + :param body: (required) + :type body: Position + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Position", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def positions_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of position")], + body: Position, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update position + + + :param id: ID of position (required) + :type id: int + :param body: (required) + :type body: Position + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Position", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _positions_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/positions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def positions_post( + self, + body: Position, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Position: + """Create position + + + :param body: (required) + :type body: Position + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Position", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def positions_post_with_http_info( + self, + body: Position, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Position]: + """Create position + + + :param body: (required) + :type body: Position + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Position", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def positions_post_without_preload_content( + self, + body: Position, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create position + + + :param body: (required) + :type body: Position + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._positions_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Position", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _positions_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/positions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/position_group_api.py b/generated/sync/easybill_generated_sync/api/position_group_api.py new file mode 100644 index 0000000..63cc212 --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/position_group_api.py @@ -0,0 +1,1411 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.position_group import PositionGroup +from easybill_generated_sync.models.position_groups import PositionGroups + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class PositionGroupApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def position_groups_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PositionGroups: + """Fetch position group list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def position_groups_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PositionGroups]: + """Fetch position group list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def position_groups_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch position group list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroups", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _position_groups_get_serialize( + self, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/position-groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def position_groups_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of position group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete position group + + + :param id: ID of position group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def position_groups_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of position group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete position group + + + :param id: ID of position group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def position_groups_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of position group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete position group + + + :param id: ID of position group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _position_groups_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/position-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def position_groups_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of position group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PositionGroup: + """Fetch position group + + + :param id: ID of position group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def position_groups_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of position group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PositionGroup]: + """Fetch position group + + + :param id: ID of position group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def position_groups_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of position group")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch position group + + + :param id: ID of position group (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroup", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _position_groups_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/position-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def position_groups_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of position goup")], + body: PositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PositionGroup: + """Update position group + + + :param id: ID of position goup (required) + :type id: int + :param body: (required) + :type body: PositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroup", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def position_groups_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of position goup")], + body: PositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PositionGroup]: + """Update position group + + + :param id: ID of position goup (required) + :type id: int + :param body: (required) + :type body: PositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroup", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def position_groups_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of position goup")], + body: PositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update position group + + + :param id: ID of position goup (required) + :type id: int + :param body: (required) + :type body: PositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PositionGroup", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _position_groups_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/position-groups/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def position_groups_post( + self, + body: PositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PositionGroup: + """Create position group + + + :param body: (required) + :type body: PositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PositionGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def position_groups_post_with_http_info( + self, + body: PositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PositionGroup]: + """Create position group + + + :param body: (required) + :type body: PositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PositionGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def position_groups_post_without_preload_content( + self, + body: PositionGroup, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create position group + + + :param body: (required) + :type body: PositionGroup + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._position_groups_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "PositionGroup", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _position_groups_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/position-groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/post_box_api.py b/generated/sync/easybill_generated_sync/api/post_box_api.py new file mode 100644 index 0000000..52a4bad --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/post_box_api.py @@ -0,0 +1,894 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.post_box import PostBox +from easybill_generated_sync.models.post_boxes import PostBoxes + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class PostBoxApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def post_boxes_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter post boxes by status.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PostBoxes: + """Fetch post box list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX. + :type type: str + :param status: Filter post boxes by status. + :type status: str + :param document_id: Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_get_serialize( + limit=limit, + page=page, + type=type, + status=status, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostBoxes", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def post_boxes_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter post boxes by status.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PostBoxes]: + """Fetch post box list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX. + :type type: str + :param status: Filter post boxes by status. + :type status: str + :param document_id: Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_get_serialize( + limit=limit, + page=page, + type=type, + status=status, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostBoxes", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def post_boxes_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter post boxes by status.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch post box list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param type: Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX. + :type type: str + :param status: Filter post boxes by status. + :type status: str + :param document_id: Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_get_serialize( + limit=limit, + page=page, + type=type, + status=status, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostBoxes", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _post_boxes_get_serialize( + self, + limit, + page, + type, + status, + document_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if type is not None: + + _query_params.append(('type', type)) + + if status is not None: + + _query_params.append(('status', status)) + + if document_id is not None: + + _query_params.append(('document_id', document_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/post-boxes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def post_boxes_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of post box")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete post box + + + :param id: ID of post box (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def post_boxes_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of post box")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete post box + + + :param id: ID of post box (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def post_boxes_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of post box")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete post box + + + :param id: ID of post box (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _post_boxes_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/post-boxes/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def post_boxes_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of post box")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PostBox: + """Fetch post box + + + :param id: ID of post box (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostBox", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def post_boxes_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of post box")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PostBox]: + """Fetch post box + + + :param id: ID of post box (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostBox", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def post_boxes_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of post box")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch post box + + + :param id: ID of post box (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_boxes_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PostBox", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _post_boxes_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/post-boxes/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/project_api.py b/generated/sync/easybill_generated_sync/api/project_api.py new file mode 100644 index 0000000..df86aca --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/project_api.py @@ -0,0 +1,1445 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.project import Project +from easybill_generated_sync.models.projects import Projects + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class ProjectApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def projects_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter projects by status.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Projects: + """Fetch projects list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id. + :type customer_id: str + :param status: Filter projects by status. + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Projects", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def projects_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter projects by status.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Projects]: + """Fetch projects list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id. + :type customer_id: str + :param status: Filter projects by status. + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Projects", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def projects_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + customer_id: Annotated[Optional[StrictStr], Field(description="Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id.")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter projects by status.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch projects list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param customer_id: Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id. + :type customer_id: str + :param status: Filter projects by status. + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_get_serialize( + limit=limit, + page=page, + customer_id=customer_id, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Projects", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _projects_get_serialize( + self, + limit, + page, + customer_id, + status, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if customer_id is not None: + + _query_params.append(('customer_id', customer_id)) + + if status is not None: + + _query_params.append(('status', status)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def projects_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete project + + + :param id: ID of project (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def projects_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete project + + + :param id: ID of project (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def projects_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete project + + + :param id: ID of project (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _projects_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/projects/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def projects_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Fetch project + + + :param id: ID of project (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def projects_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Fetch project + + + :param id: ID of project (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def projects_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch project + + + :param id: ID of project (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _projects_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def projects_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + body: Project, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Update project + + + :param id: ID of project (required) + :type id: int + :param body: (required) + :type body: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def projects_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + body: Project, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Update project + + + :param id: ID of project (required) + :type id: int + :param body: (required) + :type body: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def projects_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of project")], + body: Project, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update project + + + :param id: ID of project (required) + :type id: int + :param body: (required) + :type body: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Project", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _projects_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/projects/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def projects_post( + self, + body: Project, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Create project + + + :param body: (required) + :type body: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Project", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def projects_post_with_http_info( + self, + body: Project, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Create project + + + :param body: (required) + :type body: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Project", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def projects_post_without_preload_content( + self, + body: Project, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create project + + + :param body: (required) + :type body: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._projects_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Project", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _projects_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/projects', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/sepa_payment_api.py b/generated/sync/easybill_generated_sync/api/sepa_payment_api.py new file mode 100644 index 0000000..71b2e29 --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/sepa_payment_api.py @@ -0,0 +1,1428 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.sepa_payment import SEPAPayment +from easybill_generated_sync.models.sepa_payments import SEPAPayments + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class SepaPaymentApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def sepa_payments_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SEPAPayments: + """Fetch SEPA payments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param document_id: Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_get_serialize( + limit=limit, + page=page, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayments", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sepa_payments_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SEPAPayments]: + """Fetch SEPA payments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param document_id: Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_get_serialize( + limit=limit, + page=page, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayments", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sepa_payments_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch SEPA payments list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param document_id: Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_get_serialize( + limit=limit, + page=page, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayments", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sepa_payments_get_serialize( + self, + limit, + page, + document_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if document_id is not None: + + _query_params.append(('document_id', document_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sepa-payments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sepa_payments_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of SPEA payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete SEPA payment + + + :param id: ID of SPEA payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sepa_payments_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of SPEA payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete SEPA payment + + + :param id: ID of SPEA payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sepa_payments_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of SPEA payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete SEPA payment + + + :param id: ID of SPEA payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sepa_payments_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/sepa-payments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sepa_payments_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of SEPA payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SEPAPayment: + """Fetch SEPA payment + + + :param id: ID of SEPA payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sepa_payments_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of SEPA payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SEPAPayment]: + """Fetch SEPA payment + + + :param id: ID of SEPA payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sepa_payments_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of SEPA payment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch SEPA payment + + + :param id: ID of SEPA payment (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayment", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sepa_payments_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sepa-payments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sepa_payments_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of SEPA payment")], + body: SEPAPayment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SEPAPayment: + """Update SEPA payment + + + :param id: ID of SEPA payment (required) + :type id: int + :param body: (required) + :type body: SEPAPayment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayment", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sepa_payments_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of SEPA payment")], + body: SEPAPayment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SEPAPayment]: + """Update SEPA payment + + + :param id: ID of SEPA payment (required) + :type id: int + :param body: (required) + :type body: SEPAPayment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayment", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sepa_payments_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of SEPA payment")], + body: SEPAPayment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update SEPA payment + + + :param id: ID of SEPA payment (required) + :type id: int + :param body: (required) + :type body: SEPAPayment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SEPAPayment", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sepa_payments_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/sepa-payments/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def sepa_payments_post( + self, + body: SEPAPayment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SEPAPayment: + """Create SEPA payment + + + :param body: (required) + :type body: SEPAPayment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SEPAPayment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def sepa_payments_post_with_http_info( + self, + body: SEPAPayment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SEPAPayment]: + """Create SEPA payment + + + :param body: (required) + :type body: SEPAPayment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SEPAPayment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def sepa_payments_post_without_preload_content( + self, + body: SEPAPayment, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create SEPA payment + + + :param body: (required) + :type body: SEPAPayment + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._sepa_payments_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "SEPAPayment", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _sepa_payments_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sepa-payments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/serial_number_api.py b/generated/sync/easybill_generated_sync/api/serial_number_api.py new file mode 100644 index 0000000..832cb68 --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/serial_number_api.py @@ -0,0 +1,1175 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.serial_number import SerialNumber +from easybill_generated_sync.models.serial_numbers import SerialNumbers + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class SerialNumberApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def serial_numbers_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + position_id: Annotated[Optional[StrictStr], Field(description="Filter serial numbers by position id.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter serial numbers by document id.")] = None, + in_use: Annotated[Optional[StrictBool], Field(description="Filter serial numbers by usage.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SerialNumbers: + """Fetch a list of serial numbers for positions + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param position_id: Filter serial numbers by position id. + :type position_id: str + :param document_id: Filter serial numbers by document id. + :type document_id: str + :param in_use: Filter serial numbers by usage. + :type in_use: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_get_serialize( + limit=limit, + page=page, + position_id=position_id, + document_id=document_id, + in_use=in_use, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumbers", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def serial_numbers_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + position_id: Annotated[Optional[StrictStr], Field(description="Filter serial numbers by position id.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter serial numbers by document id.")] = None, + in_use: Annotated[Optional[StrictBool], Field(description="Filter serial numbers by usage.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SerialNumbers]: + """Fetch a list of serial numbers for positions + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param position_id: Filter serial numbers by position id. + :type position_id: str + :param document_id: Filter serial numbers by document id. + :type document_id: str + :param in_use: Filter serial numbers by usage. + :type in_use: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_get_serialize( + limit=limit, + page=page, + position_id=position_id, + document_id=document_id, + in_use=in_use, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumbers", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def serial_numbers_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + position_id: Annotated[Optional[StrictStr], Field(description="Filter serial numbers by position id.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter serial numbers by document id.")] = None, + in_use: Annotated[Optional[StrictBool], Field(description="Filter serial numbers by usage.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch a list of serial numbers for positions + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param position_id: Filter serial numbers by position id. + :type position_id: str + :param document_id: Filter serial numbers by document id. + :type document_id: str + :param in_use: Filter serial numbers by usage. + :type in_use: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_get_serialize( + limit=limit, + page=page, + position_id=position_id, + document_id=document_id, + in_use=in_use, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumbers", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _serial_numbers_get_serialize( + self, + limit, + page, + position_id, + document_id, + in_use, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if position_id is not None: + + _query_params.append(('position_id', position_id)) + + if document_id is not None: + + _query_params.append(('document_id', document_id)) + + if in_use is not None: + + _query_params.append(('in_use', in_use)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/serial-numbers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def serial_numbers_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of the serial number that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a serial number for a position + + + :param id: ID of the serial number that needs to be deleted (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def serial_numbers_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the serial number that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a serial number for a position + + + :param id: ID of the serial number that needs to be deleted (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def serial_numbers_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the serial number that needs to be deleted")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a serial number for a position + + + :param id: ID of the serial number that needs to be deleted (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _serial_numbers_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/serial-numbers/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def serial_numbers_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of the serial number that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SerialNumber: + """Fetch a serial number for a position + + + :param id: ID of the serial number that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumber", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def serial_numbers_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the serial number that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SerialNumber]: + """Fetch a serial number for a position + + + :param id: ID of the serial number that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumber", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def serial_numbers_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the serial number that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch a serial number for a position + + + :param id: ID of the serial number that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumber", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _serial_numbers_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/serial-numbers/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def serial_numbers_post( + self, + body: Optional[SerialNumber] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SerialNumber: + """Create s serial number for a position + + + :param body: + :type body: SerialNumber + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumber", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def serial_numbers_post_with_http_info( + self, + body: Optional[SerialNumber] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SerialNumber]: + """Create s serial number for a position + + + :param body: + :type body: SerialNumber + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumber", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def serial_numbers_post_without_preload_content( + self, + body: Optional[SerialNumber] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create s serial number for a position + + + :param body: + :type body: SerialNumber + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._serial_numbers_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SerialNumber", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _serial_numbers_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/serial-numbers', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/stock_api.py b/generated/sync/easybill_generated_sync/api/stock_api.py new file mode 100644 index 0000000..c6a289d --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/stock_api.py @@ -0,0 +1,897 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.stock import Stock +from easybill_generated_sync.models.stocks import Stocks + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class StockApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def stocks_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + position_id: Annotated[Optional[StrictStr], Field(description="Filter stock entries by position id.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter stock entries by document id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Stocks: + """Fetch a list of stock entries for positions + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param position_id: Filter stock entries by position id. + :type position_id: str + :param document_id: Filter stock entries by document id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_get_serialize( + limit=limit, + page=page, + position_id=position_id, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Stocks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def stocks_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + position_id: Annotated[Optional[StrictStr], Field(description="Filter stock entries by position id.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter stock entries by document id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Stocks]: + """Fetch a list of stock entries for positions + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param position_id: Filter stock entries by position id. + :type position_id: str + :param document_id: Filter stock entries by document id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_get_serialize( + limit=limit, + page=page, + position_id=position_id, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Stocks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def stocks_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + position_id: Annotated[Optional[StrictStr], Field(description="Filter stock entries by position id.")] = None, + document_id: Annotated[Optional[StrictStr], Field(description="Filter stock entries by document id.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch a list of stock entries for positions + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param position_id: Filter stock entries by position id. + :type position_id: str + :param document_id: Filter stock entries by document id. + :type document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_get_serialize( + limit=limit, + page=page, + position_id=position_id, + document_id=document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Stocks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _stocks_get_serialize( + self, + limit, + page, + position_id, + document_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if position_id is not None: + + _query_params.append(('position_id', position_id)) + + if document_id is not None: + + _query_params.append(('document_id', document_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/stocks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def stocks_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of the stock entry that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Stock: + """Fetch an stock entry for a position + + + :param id: ID of the stock entry that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Stock", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def stocks_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of the stock entry that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Stock]: + """Fetch an stock entry for a position + + + :param id: ID of the stock entry that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Stock", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def stocks_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of the stock entry that needs to be fetched")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch an stock entry for a position + + + :param id: ID of the stock entry that needs to be fetched (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Stock", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _stocks_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/stocks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def stocks_post( + self, + body: Stock, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Stock: + """Create a stock entry for a position + + + :param body: (required) + :type body: Stock + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Stock", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def stocks_post_with_http_info( + self, + body: Stock, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Stock]: + """Create a stock entry for a position + + + :param body: (required) + :type body: Stock + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Stock", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def stocks_post_without_preload_content( + self, + body: Stock, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a stock entry for a position + + + :param body: (required) + :type body: Stock + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stocks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Stock", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _stocks_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/stocks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/task_api.py b/generated/sync/easybill_generated_sync/api/task_api.py new file mode 100644 index 0000000..997603c --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/task_api.py @@ -0,0 +1,1411 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.task import Task +from easybill_generated_sync.models.tasks import Tasks + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class TaskApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def tasks_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Tasks: + """Fetch tasks list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Tasks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def tasks_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Tasks]: + """Fetch tasks list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Tasks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def tasks_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch tasks list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Tasks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tasks_get_serialize( + self, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tasks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def tasks_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete task + + + :param id: ID of task (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def tasks_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete task + + + :param id: ID of task (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def tasks_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete task + + + :param id: ID of task (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tasks_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/tasks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def tasks_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Task: + """Fetch task + + + :param id: ID of task (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def tasks_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Task]: + """Fetch task + + + :param id: ID of task (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def tasks_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch task + + + :param id: ID of task (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tasks_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tasks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def tasks_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + body: Task, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Task: + """Update task + + + :param id: ID of task (required) + :type id: int + :param body: (required) + :type body: Task + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def tasks_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + body: Task, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Task]: + """Update task + + + :param id: ID of task (required) + :type id: int + :param body: (required) + :type body: Task + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def tasks_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of task")], + body: Task, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update task + + + :param id: ID of task (required) + :type id: int + :param body: (required) + :type body: Task + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tasks_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/tasks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def tasks_post( + self, + body: Task, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Task: + """Create task + + + :param body: (required) + :type body: Task + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Task", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def tasks_post_with_http_info( + self, + body: Task, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Task]: + """Create task + + + :param body: (required) + :type body: Task + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Task", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def tasks_post_without_preload_content( + self, + body: Task, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create task + + + :param body: (required) + :type body: Task + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tasks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "Task", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tasks_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/tasks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/text_template_api.py b/generated/sync/easybill_generated_sync/api/text_template_api.py new file mode 100644 index 0000000..9ded74c --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/text_template_api.py @@ -0,0 +1,1411 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.text_template import TextTemplate +from easybill_generated_sync.models.text_templates import TextTemplates + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class TextTemplateApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def text_templates_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TextTemplates: + """Fetch text templates list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplates", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def text_templates_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TextTemplates]: + """Fetch text templates list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplates", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def text_templates_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch text templates list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplates", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _text_templates_get_serialize( + self, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/text-templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def text_templates_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete text template + + + :param id: ID of text template (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def text_templates_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete text template + + + :param id: ID of text template (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def text_templates_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete text template + + + :param id: ID of text template (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _text_templates_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/text-templates/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def text_templates_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TextTemplate: + """Fetch text template + + + :param id: ID of text template (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplate", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def text_templates_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TextTemplate]: + """Fetch text template + + + :param id: ID of text template (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplate", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def text_templates_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch text template + + + :param id: ID of text template (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplate", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _text_templates_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/text-templates/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def text_templates_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + body: TextTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TextTemplate: + """Update text template + + + :param id: ID of text template (required) + :type id: int + :param body: (required) + :type body: TextTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplate", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def text_templates_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + body: TextTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TextTemplate]: + """Update text template + + + :param id: ID of text template (required) + :type id: int + :param body: (required) + :type body: TextTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplate", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def text_templates_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of text template")], + body: TextTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update text template + + + :param id: ID of text template (required) + :type id: int + :param body: (required) + :type body: TextTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TextTemplate", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _text_templates_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/text-templates/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def text_templates_post( + self, + body: TextTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TextTemplate: + """Create text template + + + :param body: (required) + :type body: TextTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TextTemplate", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def text_templates_post_with_http_info( + self, + body: TextTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TextTemplate]: + """Create text template + + + :param body: (required) + :type body: TextTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TextTemplate", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def text_templates_post_without_preload_content( + self, + body: TextTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create text template + + + :param body: (required) + :type body: TextTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._text_templates_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TextTemplate", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _text_templates_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/text-templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/time_tracking_api.py b/generated/sync/easybill_generated_sync/api/time_tracking_api.py new file mode 100644 index 0000000..26d21b6 --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/time_tracking_api.py @@ -0,0 +1,1479 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.time_tracking import TimeTracking +from easybill_generated_sync.models.time_trackings import TimeTrackings + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class TimeTrackingApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def time_trackings_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + login_id: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id.")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id.")] = None, + date_from_at: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00.")] = None, + date_thru_at: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TimeTrackings: + """Fetch time trackings list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param login_id: Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id. + :type login_id: str + :param project_id: Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id. + :type project_id: str + :param date_from_at: Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. + :type date_from_at: str + :param date_thru_at: Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. + :type date_thru_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_get_serialize( + limit=limit, + page=page, + login_id=login_id, + project_id=project_id, + date_from_at=date_from_at, + date_thru_at=date_thru_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTrackings", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def time_trackings_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + login_id: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id.")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id.")] = None, + date_from_at: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00.")] = None, + date_thru_at: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TimeTrackings]: + """Fetch time trackings list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param login_id: Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id. + :type login_id: str + :param project_id: Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id. + :type project_id: str + :param date_from_at: Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. + :type date_from_at: str + :param date_thru_at: Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. + :type date_thru_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_get_serialize( + limit=limit, + page=page, + login_id=login_id, + project_id=project_id, + date_from_at=date_from_at, + date_thru_at=date_thru_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTrackings", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def time_trackings_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + login_id: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id.")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id.")] = None, + date_from_at: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00.")] = None, + date_thru_at: Annotated[Optional[StrictStr], Field(description="Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch time trackings list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param login_id: Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id. + :type login_id: str + :param project_id: Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id. + :type project_id: str + :param date_from_at: Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. + :type date_from_at: str + :param date_thru_at: Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31. You can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00. + :type date_thru_at: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_get_serialize( + limit=limit, + page=page, + login_id=login_id, + project_id=project_id, + date_from_at=date_from_at, + date_thru_at=date_thru_at, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTrackings", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _time_trackings_get_serialize( + self, + limit, + page, + login_id, + project_id, + date_from_at, + date_thru_at, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + if login_id is not None: + + _query_params.append(('login_id', login_id)) + + if project_id is not None: + + _query_params.append(('project_id', project_id)) + + if date_from_at is not None: + + _query_params.append(('date_from_at', date_from_at)) + + if date_thru_at is not None: + + _query_params.append(('date_thru_at', date_thru_at)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/time-trackings', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def time_trackings_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def time_trackings_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def time_trackings_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _time_trackings_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/time-trackings/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def time_trackings_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TimeTracking: + """Fetch time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTracking", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def time_trackings_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TimeTracking]: + """Fetch time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTracking", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def time_trackings_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTracking", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _time_trackings_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/time-trackings/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def time_trackings_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + body: TimeTracking, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TimeTracking: + """Update time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param body: (required) + :type body: TimeTracking + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTracking", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def time_trackings_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + body: TimeTracking, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TimeTracking]: + """Update time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param body: (required) + :type body: TimeTracking + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTracking", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def time_trackings_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of time tracking")], + body: TimeTracking, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update time tracking + + + :param id: ID of time tracking (required) + :type id: int + :param body: (required) + :type body: TimeTracking + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TimeTracking", + '400': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _time_trackings_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/time-trackings/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def time_trackings_post( + self, + body: TimeTracking, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TimeTracking: + """Create time tracking + + + :param body: (required) + :type body: TimeTracking + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TimeTracking", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def time_trackings_post_with_http_info( + self, + body: TimeTracking, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TimeTracking]: + """Create time tracking + + + :param body: (required) + :type body: TimeTracking + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TimeTracking", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def time_trackings_post_without_preload_content( + self, + body: TimeTracking, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create time tracking + + + :param body: (required) + :type body: TimeTracking + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._time_trackings_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TimeTracking", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _time_trackings_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/time-trackings', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api/webhook_api.py b/generated/sync/easybill_generated_sync/api/webhook_api.py new file mode 100644 index 0000000..eaedc15 --- /dev/null +++ b/generated/sync/easybill_generated_sync/api/webhook_api.py @@ -0,0 +1,1411 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt +from typing import Optional +from typing_extensions import Annotated +from easybill_generated_sync.models.web_hook import WebHook +from easybill_generated_sync.models.web_hooks import WebHooks + +from easybill_generated_sync.api_client import ApiClient, RequestSerialized +from easybill_generated_sync.api_response import ApiResponse +from easybill_generated_sync.rest import RESTResponseType + + +class WebhookApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def webhooks_get( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebHooks: + """Fetch WebHooks list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHooks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def webhooks_get_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebHooks]: + """Fetch WebHooks list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHooks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def webhooks_get_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Limited the result. Default is 100. Maximum can be 1000.")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Set current Page. Default is 1.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch WebHooks list + + + :param limit: Limited the result. Default is 100. Maximum can be 1000. + :type limit: int + :param page: Set current Page. Default is 1. + :type page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_get_serialize( + limit=limit, + page=page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHooks", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _webhooks_get_serialize( + self, + limit, + page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if page is not None: + + _query_params.append(('page', page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/webhooks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def webhooks_id_delete( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def webhooks_id_delete_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def webhooks_id_delete_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _webhooks_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/webhooks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def webhooks_id_get( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebHook: + """Fetch WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHook", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def webhooks_id_get_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebHook]: + """Fetch WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHook", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def webhooks_id_get_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHook", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _webhooks_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/webhooks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def webhooks_id_put( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + body: WebHook, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebHook: + """Update WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param body: (required) + :type body: WebHook + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHook", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def webhooks_id_put_with_http_info( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + body: WebHook, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebHook]: + """Update WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param body: (required) + :type body: WebHook + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHook", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def webhooks_id_put_without_preload_content( + self, + id: Annotated[StrictInt, Field(description="ID of WebHook")], + body: WebHook, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update WebHook + + + :param id: ID of WebHook (required) + :type id: int + :param body: (required) + :type body: WebHook + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_id_put_serialize( + id=id, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WebHook", + '404': None, + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _webhooks_id_put_serialize( + self, + id, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/webhooks/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def webhooks_post( + self, + body: WebHook, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WebHook: + """Create WebHook + + + :param body: (required) + :type body: WebHook + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebHook", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def webhooks_post_with_http_info( + self, + body: WebHook, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WebHook]: + """Create WebHook + + + :param body: (required) + :type body: WebHook + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebHook", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def webhooks_post_without_preload_content( + self, + body: WebHook, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create WebHook + + + :param body: (required) + :type body: WebHook + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._webhooks_post_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "WebHook", + '429': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _webhooks_post_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth', + 'Bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/webhooks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/generated/sync/easybill_generated_sync/api_client.py b/generated/sync/easybill_generated_sync/api_client.py new file mode 100644 index 0000000..11b3b4b --- /dev/null +++ b/generated/sync/easybill_generated_sync/api_client.py @@ -0,0 +1,811 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + + +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal +import json +import mimetypes +import os +import re +import tempfile +import uuid + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from easybill_generated_sync.configuration import Configuration +from easybill_generated_sync.api_response import ApiResponse, T as ApiResponseT +import easybill_generated_sync.models +from easybill_generated_sync import rest +from easybill_generated_sync.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'UUID': uuid.UUID, + 'object': object, + } + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.client_side_validation = configuration.client_side_validation + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_value, traceback): + await self.close() + + async def close(self): + await self.rest_client.close() + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None or self.configuration.ignore_operation_servers: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + async def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = await self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type in ("bytearray", "bytes"): + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.headers.get('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.headers, + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, uuid.UUID): + return str(obj) + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() + return self.sanitize_for_serialization(obj_dict) + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. + + :return: deserialized object. + """ + + # fetch data from response object + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(easybill_generated_sync.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass is object: + return self.__deserialize_object(data) + elif klass is datetime.date: + return self.__deserialize_date(data) + elif klass is datetime.datetime: + return self.__deserialize_datetime(data) + elif klass is decimal.Decimal: + return decimal.Decimal(data) + elif klass is uuid.UUID: + return uuid.UUID(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, quote(str(value))) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.headers.get("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = os.path.basename(m.group(1)) # Strip any directory traversal + if filename in ("", ".", ".."): # fall back to tmp filename + filename = os.path.basename(path) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/generated/sync/easybill_generated_sync/api_response.py b/generated/sync/easybill_generated_sync/api_response.py new file mode 100644 index 0000000..9bc7c11 --- /dev/null +++ b/generated/sync/easybill_generated_sync/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/generated/sync/easybill_generated_sync/configuration.py b/generated/sync/easybill_generated_sync/configuration.py new file mode 100644 index 0000000..f65b7e8 --- /dev/null +++ b/generated/sync/easybill_generated_sync/configuration.py @@ -0,0 +1,648 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import base64 +import copy +import http.client as httplib +import logging +from logging import FileHandler +import sys +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union +from typing_extensions import NotRequired, Self + + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "Bearer": APIKeyAuthSetting, + "basicAuth": BasicAuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: int | aiohttp_retry.RetryOptionsBase - Retry configuration. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. + :param cert_file: the path to a client certificate file, for mTLS. + :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = easybill_generated_sync.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + + Configure API client with HTTP basic authentication: + +conf = easybill_generated_sync.Configuration( + username='the-user', + password='the-password', +) + + """ + + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[Union[int, Any]] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + cert_file: Optional[str]=None, + key_file: Optional[str]=None, + verify_ssl: bool=True, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", + *, + debug: Optional[bool] = None, + ) -> None: + """Constructor + """ + self._base_path = "https://api.easybill.de/rest/v1" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("easybill_generated_sync") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + self.__debug = False + """Debug switch + """ + + self.verify_ssl = verify_ssl + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ + self.cert_file = cert_file + """client certificate file + """ + self.key_file = key_file + """client key file + """ + self.assert_hostname = assert_hostname + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = tls_server_name + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100 + """This value is passed to the aiohttp to limit simultaneous connections. + None in the constructor is coerced to default 100. + """ + + self.proxy = proxy + """Proxy URL + """ + self.proxy_headers = proxy_headers + """Proxy headers + """ + self.safe_chars_for_path_param = safe_chars_for_path_param + """Safe chars for path_param + """ + self.retries = retries + """Retry configuration + """ + # Enable client side validation + self.client_side_validation = client_side_validation + + self.socket_options = socket_options + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = datetime_format + """datetime format + """ + + self.date_format = date_format + """date format + """ + + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name: str, value: Any) -> None: + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default: Optional[Self]) -> None: + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls) -> Self: + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls) -> Self: + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = cls() + return cls._default + + @property + def logger_file(self) -> Optional[str]: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value: Optional[str]) -> None: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self) -> bool: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value: bool) -> None: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self) -> str: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value: str) -> None: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + return None + + def get_basic_auth_token(self) -> Optional[str]: + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + + return "Basic " + base64.b64encode( + (username + ":" + password).encode('utf-8') + ).decode('utf-8') + + def auth_settings(self)-> AuthSettings: + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth: AuthSettings = {} + if 'Bearer' in self.api_key: + auth['Bearer'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_api_key_with_prefix( + 'Bearer', + ), + } + if self.username is not None and self.password is not None: + auth['basicAuth'] = { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + } + return auth + + def to_debug_report(self) -> str: + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.96.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self) -> List[HostSetting]: + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "https://api.easybill.de/rest/v1", + 'description': "No description provided", + } + ] + + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and variable['enum_values'] \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self) -> str: + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value: str) -> None: + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/generated/sync/easybill_generated_sync/exceptions.py b/generated/sync/easybill_generated_sync/exceptions.py new file mode 100644 index 0000000..b356261 --- /dev/null +++ b/generated/sync/easybill_generated_sync/exceptions.py @@ -0,0 +1,218 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from typing import Any, Optional +from typing_extensions import Self + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.headers + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + if self.data: + error_message += "HTTP response data: {0}\n".format(self.data) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/generated/sync/easybill_generated_sync/models/__init__.py b/generated/sync/easybill_generated_sync/models/__init__.py new file mode 100644 index 0000000..94fabbf --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/__init__.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +# flake8: noqa +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +# import models into model package +from easybill_generated_sync.models.advanced_data_field import AdvancedDataField +from easybill_generated_sync.models.attachment import Attachment +from easybill_generated_sync.models.attachments import Attachments +from easybill_generated_sync.models.contact import Contact +from easybill_generated_sync.models.contacts import Contacts +from easybill_generated_sync.models.customer import Customer +from easybill_generated_sync.models.customer_group import CustomerGroup +from easybill_generated_sync.models.customer_groups import CustomerGroups +from easybill_generated_sync.models.customer_snapshot import CustomerSnapshot +from easybill_generated_sync.models.customers import Customers +from easybill_generated_sync.models.discount import Discount +from easybill_generated_sync.models.discount_position import DiscountPosition +from easybill_generated_sync.models.discount_position_group import DiscountPositionGroup +from easybill_generated_sync.models.discount_position_groups import DiscountPositionGroups +from easybill_generated_sync.models.discount_positions import DiscountPositions +from easybill_generated_sync.models.document import Document +from easybill_generated_sync.models.document_address import DocumentAddress +from easybill_generated_sync.models.document_payment import DocumentPayment +from easybill_generated_sync.models.document_payments import DocumentPayments +from easybill_generated_sync.models.document_position import DocumentPosition +from easybill_generated_sync.models.document_recurring import DocumentRecurring +from easybill_generated_sync.models.document_version import DocumentVersion +from easybill_generated_sync.models.document_version_item import DocumentVersionItem +from easybill_generated_sync.models.document_versions import DocumentVersions +from easybill_generated_sync.models.documents import Documents +from easybill_generated_sync.models.file_format_config import FileFormatConfig +from easybill_generated_sync.models.list import List +from easybill_generated_sync.models.login import Login +from easybill_generated_sync.models.login_security import LoginSecurity +from easybill_generated_sync.models.logins import Logins +from easybill_generated_sync.models.pdf_template import PDFTemplate +from easybill_generated_sync.models.pdf_template_settings import PDFTemplateSettings +from easybill_generated_sync.models.pdf_template_settings_email import PDFTemplateSettingsEmail +from easybill_generated_sync.models.pdf_templates import PDFTemplates +from easybill_generated_sync.models.position import Position +from easybill_generated_sync.models.position_export_identifier_extended import PositionExportIdentifierExtended +from easybill_generated_sync.models.position_group import PositionGroup +from easybill_generated_sync.models.position_groups import PositionGroups +from easybill_generated_sync.models.positions import Positions +from easybill_generated_sync.models.post_box import PostBox +from easybill_generated_sync.models.post_box_request import PostBoxRequest +from easybill_generated_sync.models.post_boxes import PostBoxes +from easybill_generated_sync.models.project import Project +from easybill_generated_sync.models.projects import Projects +from easybill_generated_sync.models.sepa_payment import SEPAPayment +from easybill_generated_sync.models.sepa_payments import SEPAPayments +from easybill_generated_sync.models.serial_number import SerialNumber +from easybill_generated_sync.models.serial_numbers import SerialNumbers +from easybill_generated_sync.models.service_date import ServiceDate +from easybill_generated_sync.models.stock import Stock +from easybill_generated_sync.models.stocks import Stocks +from easybill_generated_sync.models.task import Task +from easybill_generated_sync.models.tasks import Tasks +from easybill_generated_sync.models.text_template import TextTemplate +from easybill_generated_sync.models.text_templates import TextTemplates +from easybill_generated_sync.models.time_tracking import TimeTracking +from easybill_generated_sync.models.time_trackings import TimeTrackings +from easybill_generated_sync.models.web_hook import WebHook +from easybill_generated_sync.models.web_hook_last_response import WebHookLastResponse +from easybill_generated_sync.models.web_hooks import WebHooks + diff --git a/generated/sync/easybill_generated_sync/models/advanced_data_field.py b/generated/sync/easybill_generated_sync/models/advanced_data_field.py new file mode 100644 index 0000000..270d6d6 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/advanced_data_field.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AdvancedDataField(BaseModel): + """ + EN16931 Business Term (BT field) for structured invoice data + """ # noqa: E501 + identifier: StrictStr = Field(description="BT field identifier (e.g. 'BT-10' for Buyer reference, 'BT-84' for Payment account identifier)") + value: StrictStr = Field(description="Field value") + __properties: ClassVar[List[str]] = ["identifier", "value"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AdvancedDataField from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AdvancedDataField from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "identifier": obj.get("identifier"), + "value": obj.get("value") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/attachment.py b/generated/sync/easybill_generated_sync/models/attachment.py new file mode 100644 index 0000000..6d14796 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/attachment.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Attachment(BaseModel): + """ + If customer_id, project_id and document_id are null, the attachment has a global context and is accessible from the web ui. Keep in mind only to provide one of the four context. You can't attach a file to several context in one request. A error is thrown if you provide two or more context (i. E. sending customer_id, document_id and project_id in combination). + """ # noqa: E501 + created_at: Optional[date] = None + customer_id: Optional[StrictInt] = None + document_id: Optional[StrictInt] = None + file_name: Optional[StrictStr] = None + id: Optional[StrictInt] = None + project_id: Optional[StrictInt] = None + size: Optional[StrictInt] = Field(default=None, description="In byte") + __properties: ClassVar[List[str]] = ["created_at", "customer_id", "document_id", "file_name", "id", "project_id", "size"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Attachment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "file_name", + "id", + "size", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if customer_id (nullable) is None + # and model_fields_set contains the field + if self.customer_id is None and "customer_id" in self.model_fields_set: + _dict['customer_id'] = None + + # set to None if document_id (nullable) is None + # and model_fields_set contains the field + if self.document_id is None and "document_id" in self.model_fields_set: + _dict['document_id'] = None + + # set to None if project_id (nullable) is None + # and model_fields_set contains the field + if self.project_id is None and "project_id" in self.model_fields_set: + _dict['project_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Attachment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "customer_id": obj.get("customer_id"), + "document_id": obj.get("document_id"), + "file_name": obj.get("file_name"), + "id": obj.get("id"), + "project_id": obj.get("project_id"), + "size": obj.get("size") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/attachments.py b/generated/sync/easybill_generated_sync/models/attachments.py new file mode 100644 index 0000000..cf452c3 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/attachments.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.attachment import Attachment +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Attachments(BaseModel): + """ + Attachments + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Attachment]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Attachments from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Attachments from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Attachment.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/contact.py b/generated/sync/easybill_generated_sync/models/contact.py new file mode 100644 index 0000000..7f79f4e --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/contact.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Contact(BaseModel): + """ + Contact + """ # noqa: E501 + city: StrictStr + state: Optional[StrictStr] = None + company_name: Optional[StrictStr] = None + country: Optional[StrictStr] = Field(default=None, description="Two-letter country code") + department: Optional[StrictStr] = 'null' + emails: Optional[List[StrictStr]] = None + fax: Optional[StrictStr] = 'null' + first_name: Optional[StrictStr] = 'null' + id: Optional[StrictInt] = None + last_name: Optional[StrictStr] = 'null' + login_id: Optional[StrictInt] = None + mobile: Optional[StrictStr] = 'null' + note: Optional[StrictStr] = 'null' + personal: Optional[StrictBool] = False + phone_1: Optional[StrictStr] = 'null' + phone_2: Optional[StrictStr] = 'null' + salutation: Optional[StrictInt] = Field(default=None, description="0: empty
1: Herrn
2: Frau
3: Firma
4: Herrn und Frau
5: Eheleute
6: Familie") + street: StrictStr + suffix_1: Optional[StrictStr] = 'null' + suffix_2: Optional[StrictStr] = 'null' + title: Optional[StrictStr] = 'null' + zip_code: Optional[StrictStr] = 'null' + created_at: Optional[StrictStr] = None + updated_at: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["city", "state", "company_name", "country", "department", "emails", "fax", "first_name", "id", "last_name", "login_id", "mobile", "note", "personal", "phone_1", "phone_2", "salutation", "street", "suffix_1", "suffix_2", "title", "zip_code", "created_at", "updated_at"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Contact from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "login_id", + "created_at", + "updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if company_name (nullable) is None + # and model_fields_set contains the field + if self.company_name is None and "company_name" in self.model_fields_set: + _dict['company_name'] = None + + # set to None if department (nullable) is None + # and model_fields_set contains the field + if self.department is None and "department" in self.model_fields_set: + _dict['department'] = None + + # set to None if fax (nullable) is None + # and model_fields_set contains the field + if self.fax is None and "fax" in self.model_fields_set: + _dict['fax'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['first_name'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['last_name'] = None + + # set to None if mobile (nullable) is None + # and model_fields_set contains the field + if self.mobile is None and "mobile" in self.model_fields_set: + _dict['mobile'] = None + + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if phone_1 (nullable) is None + # and model_fields_set contains the field + if self.phone_1 is None and "phone_1" in self.model_fields_set: + _dict['phone_1'] = None + + # set to None if phone_2 (nullable) is None + # and model_fields_set contains the field + if self.phone_2 is None and "phone_2" in self.model_fields_set: + _dict['phone_2'] = None + + # set to None if suffix_1 (nullable) is None + # and model_fields_set contains the field + if self.suffix_1 is None and "suffix_1" in self.model_fields_set: + _dict['suffix_1'] = None + + # set to None if suffix_2 (nullable) is None + # and model_fields_set contains the field + if self.suffix_2 is None and "suffix_2" in self.model_fields_set: + _dict['suffix_2'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + # set to None if zip_code (nullable) is None + # and model_fields_set contains the field + if self.zip_code is None and "zip_code" in self.model_fields_set: + _dict['zip_code'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Contact from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "city": obj.get("city"), + "state": obj.get("state"), + "company_name": obj.get("company_name"), + "country": obj.get("country"), + "department": obj.get("department") if obj.get("department") is not None else 'null', + "emails": obj.get("emails"), + "fax": obj.get("fax") if obj.get("fax") is not None else 'null', + "first_name": obj.get("first_name") if obj.get("first_name") is not None else 'null', + "id": obj.get("id"), + "last_name": obj.get("last_name") if obj.get("last_name") is not None else 'null', + "login_id": obj.get("login_id"), + "mobile": obj.get("mobile") if obj.get("mobile") is not None else 'null', + "note": obj.get("note") if obj.get("note") is not None else 'null', + "personal": obj.get("personal") if obj.get("personal") is not None else False, + "phone_1": obj.get("phone_1") if obj.get("phone_1") is not None else 'null', + "phone_2": obj.get("phone_2") if obj.get("phone_2") is not None else 'null', + "salutation": obj.get("salutation"), + "street": obj.get("street"), + "suffix_1": obj.get("suffix_1") if obj.get("suffix_1") is not None else 'null', + "suffix_2": obj.get("suffix_2") if obj.get("suffix_2") is not None else 'null', + "title": obj.get("title") if obj.get("title") is not None else 'null', + "zip_code": obj.get("zip_code") if obj.get("zip_code") is not None else 'null', + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/contacts.py b/generated/sync/easybill_generated_sync/models/contacts.py new file mode 100644 index 0000000..ea268fb --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/contacts.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.contact import Contact +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Contacts(BaseModel): + """ + Contacts + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Contact]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Contacts from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Contacts from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Contact.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/customer.py b/generated/sync/easybill_generated_sync/models/customer.py new file mode 100644 index 0000000..ab1b2ad --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/customer.py @@ -0,0 +1,577 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Customer(BaseModel): + """ + Customer + """ # noqa: E501 + acquire_options: Optional[StrictInt] = Field(default=None, description="1 = Empfehlung eines anderen Kunden, 2 = Zeitungsanzeige, 3 = Eigene Akquisition, 4 = Mitarbeiter Akquisition, 5 = Google, 6 = Gelbe Seiten, 7 = Kostenlose Internet Plattform, 8 = Bezahlte Internet Plattform") + additional_groups_ids: Optional[List[StrictInt]] = None + bank_account: Optional[StrictStr] = None + bank_account_owner: Optional[StrictStr] = None + bank_bic: Optional[StrictStr] = None + bank_code: Optional[StrictStr] = None + bank_iban: Optional[StrictStr] = None + bank_name: Optional[StrictStr] = None + birth_date: Optional[date] = None + cash_allowance: Optional[Union[Annotated[float, Field(le=1E+2, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = None + cash_allowance_days: Optional[StrictInt] = None + cash_discount: Optional[Union[StrictFloat, StrictInt]] = None + cash_discount_type: Optional[StrictStr] = None + city: Optional[StrictStr] = None + state: Optional[StrictStr] = None + company_name: Optional[StrictStr] + country: Optional[StrictStr] = None + created_at: Optional[date] = None + updated_at: Optional[StrictStr] = None + delivery_title: Optional[StrictStr] = None + delivery_city: Optional[StrictStr] = None + delivery_state: Optional[StrictStr] = None + delivery_company_name: Optional[StrictStr] = None + delivery_country: Optional[StrictStr] = None + delivery_first_name: Optional[StrictStr] = None + delivery_last_name: Optional[StrictStr] = None + delivery_personal: Optional[StrictBool] = None + delivery_salutation: Optional[StrictInt] = Field(default=None, description="0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family") + delivery_street: Optional[StrictStr] = None + delivery_suffix_1: Optional[StrictStr] = None + delivery_suffix_2: Optional[StrictStr] = None + delivery_zip_code: Optional[StrictStr] = None + display_name: Optional[StrictStr] = None + emails: Optional[List[StrictStr]] = None + fax: Optional[StrictStr] = None + first_name: Optional[StrictStr] = None + grace_period: Optional[StrictInt] = Field(default=None, description="will be replaced by its alias due_in_days.") + due_in_days: Optional[StrictInt] = Field(default=None, description="due date in days") + group_id: Optional[StrictInt] = None + id: Optional[StrictInt] = None + info_1: Optional[StrictStr] = None + info_2: Optional[StrictStr] = None + internet: Optional[StrictStr] = None + last_name: Optional[StrictStr] + login_id: Optional[StrictInt] = None + mobile: Optional[StrictStr] = None + note: Optional[StrictStr] = None + number: Optional[StrictStr] = Field(default=None, description="Automatically generated if empty/omitted and when no type in query is provided or the type 'CUSTOMER', 'CUSTOMER,SUPPLIER'") + supplier_number: Optional[StrictStr] = Field(default=None, description="Automatically generated if the type SUPPLIER or 'CUSTOMER,SUPPLIER' is provided as query parameter and the field supplier_number is empty/omitted.") + payment_options: Optional[StrictInt] = Field(default=None, description="1 = Stets pünktliche Zahlung, 2 = überwiegend pünktliche Zahlung, 3 = überwiegend verspätete Zahlung, 5 = Grundsätzlich verspätete Zahlung") + personal: Optional[StrictBool] = False + phone_1: Optional[StrictStr] = None + phone_2: Optional[StrictStr] = None + postbox: Optional[StrictStr] = None + postbox_city: Optional[StrictStr] = None + postbox_state: Optional[StrictStr] = None + postbox_country: Optional[StrictStr] = None + postbox_zip_code: Optional[StrictStr] = None + sale_price_level: Optional[StrictStr] = None + salutation: Optional[StrictInt] = Field(default=None, description="0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family") + sepa_agreement: Optional[StrictStr] = Field(default=None, description="BASIC = SEPA-Basislastschrift, COR1 = SEPA-Basislastschrift COR1 (deprecated use BASIC instead), COMPANY = SEPA-Firmenlastschrift, NULL = Noch kein Mandat erteilt") + sepa_agreement_date: Optional[date] = None + sepa_mandate_reference: Optional[StrictStr] = None + since_date: Optional[date] = None + street: Optional[StrictStr] = None + suffix_1: Optional[StrictStr] = None + suffix_2: Optional[StrictStr] = None + tax_number: Optional[StrictStr] = None + court: Optional[StrictStr] = None + court_registry_number: Optional[StrictStr] = None + tax_options: Optional[StrictStr] = Field(default=None, description="nStb = Nicht steuerbar (Drittland), nStbUstID = Nicht steuerbar (EU mit USt-IdNr.), nStbNoneUstID = Nicht steuerbar (EU ohne USt-IdNr.), revc = Steuerschuldwechsel §13b (Inland), IG = Innergemeinschaftliche Lieferung, AL = Ausfuhrlieferung, sStfr = sonstige Steuerbefreiung, NULL = Umsatzsteuerpflichtig") + title: Optional[StrictStr] = None + archived: Optional[StrictBool] = None + vat_identifier: Optional[StrictStr] = None + zip_code: Optional[StrictStr] = None + document_pdf_type: Optional[StrictStr] = Field(default='default', description="Type of PDF to use when sending a Document to the Customer.") + buyer_reference: Optional[StrictStr] = Field(default=None, description="Used as \"buyerReference\" in ZUGFeRD and as \"Leitweg-ID\" in the XRechnung format.") + foreign_supplier_number: Optional[StrictStr] = Field(default=None, description="The ID given to your company by the customer in his system.") + __properties: ClassVar[List[str]] = ["acquire_options", "additional_groups_ids", "bank_account", "bank_account_owner", "bank_bic", "bank_code", "bank_iban", "bank_name", "birth_date", "cash_allowance", "cash_allowance_days", "cash_discount", "cash_discount_type", "city", "state", "company_name", "country", "created_at", "updated_at", "delivery_title", "delivery_city", "delivery_state", "delivery_company_name", "delivery_country", "delivery_first_name", "delivery_last_name", "delivery_personal", "delivery_salutation", "delivery_street", "delivery_suffix_1", "delivery_suffix_2", "delivery_zip_code", "display_name", "emails", "fax", "first_name", "grace_period", "due_in_days", "group_id", "id", "info_1", "info_2", "internet", "last_name", "login_id", "mobile", "note", "number", "supplier_number", "payment_options", "personal", "phone_1", "phone_2", "postbox", "postbox_city", "postbox_state", "postbox_country", "postbox_zip_code", "sale_price_level", "salutation", "sepa_agreement", "sepa_agreement_date", "sepa_mandate_reference", "since_date", "street", "suffix_1", "suffix_2", "tax_number", "court", "court_registry_number", "tax_options", "title", "archived", "vat_identifier", "zip_code", "document_pdf_type", "buyer_reference", "foreign_supplier_number"] + + @field_validator('cash_discount_type') + def cash_discount_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PERCENT', 'AMOUNT']): + raise ValueError("must be one of enum values ('PERCENT', 'AMOUNT')") + return value + + @field_validator('sale_price_level') + def sale_price_level_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['SALEPRICE2', 'SALEPRICE3', 'SALEPRICE4', 'SALEPRICE5', 'SALEPRICE6', 'SALEPRICE7', 'SALEPRICE8', 'SALEPRICE9', 'SALEPRICE10']): + raise ValueError("must be one of enum values ('SALEPRICE2', 'SALEPRICE3', 'SALEPRICE4', 'SALEPRICE5', 'SALEPRICE6', 'SALEPRICE7', 'SALEPRICE8', 'SALEPRICE9', 'SALEPRICE10')") + return value + + @field_validator('sepa_agreement') + def sepa_agreement_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['BASIC', 'COR1', 'COMPANY', 'NULL']): + raise ValueError("must be one of enum values ('BASIC', 'COR1', 'COMPANY', 'NULL')") + return value + + @field_validator('tax_options') + def tax_options_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['nStb', 'nStbUstID', 'nStbNoneUstID', 'nStbIm', 'revc', 'IG', 'AL', 'sStfr', 'NULL']): + raise ValueError("must be one of enum values ('nStb', 'nStbUstID', 'nStbNoneUstID', 'nStbIm', 'revc', 'IG', 'AL', 'sStfr', 'NULL')") + return value + + @field_validator('document_pdf_type') + def document_pdf_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung2_1_xml', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml']): + raise ValueError("must be one of enum values ('default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung2_1_xml', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Customer from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "updated_at", + "display_name", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if acquire_options (nullable) is None + # and model_fields_set contains the field + if self.acquire_options is None and "acquire_options" in self.model_fields_set: + _dict['acquire_options'] = None + + # set to None if bank_account (nullable) is None + # and model_fields_set contains the field + if self.bank_account is None and "bank_account" in self.model_fields_set: + _dict['bank_account'] = None + + # set to None if bank_account_owner (nullable) is None + # and model_fields_set contains the field + if self.bank_account_owner is None and "bank_account_owner" in self.model_fields_set: + _dict['bank_account_owner'] = None + + # set to None if bank_bic (nullable) is None + # and model_fields_set contains the field + if self.bank_bic is None and "bank_bic" in self.model_fields_set: + _dict['bank_bic'] = None + + # set to None if bank_code (nullable) is None + # and model_fields_set contains the field + if self.bank_code is None and "bank_code" in self.model_fields_set: + _dict['bank_code'] = None + + # set to None if bank_iban (nullable) is None + # and model_fields_set contains the field + if self.bank_iban is None and "bank_iban" in self.model_fields_set: + _dict['bank_iban'] = None + + # set to None if bank_name (nullable) is None + # and model_fields_set contains the field + if self.bank_name is None and "bank_name" in self.model_fields_set: + _dict['bank_name'] = None + + # set to None if birth_date (nullable) is None + # and model_fields_set contains the field + if self.birth_date is None and "birth_date" in self.model_fields_set: + _dict['birth_date'] = None + + # set to None if cash_allowance (nullable) is None + # and model_fields_set contains the field + if self.cash_allowance is None and "cash_allowance" in self.model_fields_set: + _dict['cash_allowance'] = None + + # set to None if cash_discount (nullable) is None + # and model_fields_set contains the field + if self.cash_discount is None and "cash_discount" in self.model_fields_set: + _dict['cash_discount'] = None + + # set to None if cash_discount_type (nullable) is None + # and model_fields_set contains the field + if self.cash_discount_type is None and "cash_discount_type" in self.model_fields_set: + _dict['cash_discount_type'] = None + + # set to None if city (nullable) is None + # and model_fields_set contains the field + if self.city is None and "city" in self.model_fields_set: + _dict['city'] = None + + # set to None if company_name (nullable) is None + # and model_fields_set contains the field + if self.company_name is None and "company_name" in self.model_fields_set: + _dict['company_name'] = None + + # set to None if delivery_city (nullable) is None + # and model_fields_set contains the field + if self.delivery_city is None and "delivery_city" in self.model_fields_set: + _dict['delivery_city'] = None + + # set to None if delivery_company_name (nullable) is None + # and model_fields_set contains the field + if self.delivery_company_name is None and "delivery_company_name" in self.model_fields_set: + _dict['delivery_company_name'] = None + + # set to None if delivery_country (nullable) is None + # and model_fields_set contains the field + if self.delivery_country is None and "delivery_country" in self.model_fields_set: + _dict['delivery_country'] = None + + # set to None if delivery_first_name (nullable) is None + # and model_fields_set contains the field + if self.delivery_first_name is None and "delivery_first_name" in self.model_fields_set: + _dict['delivery_first_name'] = None + + # set to None if delivery_last_name (nullable) is None + # and model_fields_set contains the field + if self.delivery_last_name is None and "delivery_last_name" in self.model_fields_set: + _dict['delivery_last_name'] = None + + # set to None if delivery_street (nullable) is None + # and model_fields_set contains the field + if self.delivery_street is None and "delivery_street" in self.model_fields_set: + _dict['delivery_street'] = None + + # set to None if delivery_suffix_1 (nullable) is None + # and model_fields_set contains the field + if self.delivery_suffix_1 is None and "delivery_suffix_1" in self.model_fields_set: + _dict['delivery_suffix_1'] = None + + # set to None if delivery_suffix_2 (nullable) is None + # and model_fields_set contains the field + if self.delivery_suffix_2 is None and "delivery_suffix_2" in self.model_fields_set: + _dict['delivery_suffix_2'] = None + + # set to None if delivery_zip_code (nullable) is None + # and model_fields_set contains the field + if self.delivery_zip_code is None and "delivery_zip_code" in self.model_fields_set: + _dict['delivery_zip_code'] = None + + # set to None if fax (nullable) is None + # and model_fields_set contains the field + if self.fax is None and "fax" in self.model_fields_set: + _dict['fax'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['first_name'] = None + + # set to None if grace_period (nullable) is None + # and model_fields_set contains the field + if self.grace_period is None and "grace_period" in self.model_fields_set: + _dict['grace_period'] = None + + # set to None if due_in_days (nullable) is None + # and model_fields_set contains the field + if self.due_in_days is None and "due_in_days" in self.model_fields_set: + _dict['due_in_days'] = None + + # set to None if group_id (nullable) is None + # and model_fields_set contains the field + if self.group_id is None and "group_id" in self.model_fields_set: + _dict['group_id'] = None + + # set to None if info_1 (nullable) is None + # and model_fields_set contains the field + if self.info_1 is None and "info_1" in self.model_fields_set: + _dict['info_1'] = None + + # set to None if info_2 (nullable) is None + # and model_fields_set contains the field + if self.info_2 is None and "info_2" in self.model_fields_set: + _dict['info_2'] = None + + # set to None if internet (nullable) is None + # and model_fields_set contains the field + if self.internet is None and "internet" in self.model_fields_set: + _dict['internet'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['last_name'] = None + + # set to None if mobile (nullable) is None + # and model_fields_set contains the field + if self.mobile is None and "mobile" in self.model_fields_set: + _dict['mobile'] = None + + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if payment_options (nullable) is None + # and model_fields_set contains the field + if self.payment_options is None and "payment_options" in self.model_fields_set: + _dict['payment_options'] = None + + # set to None if phone_1 (nullable) is None + # and model_fields_set contains the field + if self.phone_1 is None and "phone_1" in self.model_fields_set: + _dict['phone_1'] = None + + # set to None if phone_2 (nullable) is None + # and model_fields_set contains the field + if self.phone_2 is None and "phone_2" in self.model_fields_set: + _dict['phone_2'] = None + + # set to None if postbox (nullable) is None + # and model_fields_set contains the field + if self.postbox is None and "postbox" in self.model_fields_set: + _dict['postbox'] = None + + # set to None if postbox_city (nullable) is None + # and model_fields_set contains the field + if self.postbox_city is None and "postbox_city" in self.model_fields_set: + _dict['postbox_city'] = None + + # set to None if postbox_country (nullable) is None + # and model_fields_set contains the field + if self.postbox_country is None and "postbox_country" in self.model_fields_set: + _dict['postbox_country'] = None + + # set to None if postbox_zip_code (nullable) is None + # and model_fields_set contains the field + if self.postbox_zip_code is None and "postbox_zip_code" in self.model_fields_set: + _dict['postbox_zip_code'] = None + + # set to None if sale_price_level (nullable) is None + # and model_fields_set contains the field + if self.sale_price_level is None and "sale_price_level" in self.model_fields_set: + _dict['sale_price_level'] = None + + # set to None if sepa_agreement (nullable) is None + # and model_fields_set contains the field + if self.sepa_agreement is None and "sepa_agreement" in self.model_fields_set: + _dict['sepa_agreement'] = None + + # set to None if sepa_agreement_date (nullable) is None + # and model_fields_set contains the field + if self.sepa_agreement_date is None and "sepa_agreement_date" in self.model_fields_set: + _dict['sepa_agreement_date'] = None + + # set to None if sepa_mandate_reference (nullable) is None + # and model_fields_set contains the field + if self.sepa_mandate_reference is None and "sepa_mandate_reference" in self.model_fields_set: + _dict['sepa_mandate_reference'] = None + + # set to None if since_date (nullable) is None + # and model_fields_set contains the field + if self.since_date is None and "since_date" in self.model_fields_set: + _dict['since_date'] = None + + # set to None if street (nullable) is None + # and model_fields_set contains the field + if self.street is None and "street" in self.model_fields_set: + _dict['street'] = None + + # set to None if suffix_1 (nullable) is None + # and model_fields_set contains the field + if self.suffix_1 is None and "suffix_1" in self.model_fields_set: + _dict['suffix_1'] = None + + # set to None if suffix_2 (nullable) is None + # and model_fields_set contains the field + if self.suffix_2 is None and "suffix_2" in self.model_fields_set: + _dict['suffix_2'] = None + + # set to None if tax_number (nullable) is None + # and model_fields_set contains the field + if self.tax_number is None and "tax_number" in self.model_fields_set: + _dict['tax_number'] = None + + # set to None if court (nullable) is None + # and model_fields_set contains the field + if self.court is None and "court" in self.model_fields_set: + _dict['court'] = None + + # set to None if court_registry_number (nullable) is None + # and model_fields_set contains the field + if self.court_registry_number is None and "court_registry_number" in self.model_fields_set: + _dict['court_registry_number'] = None + + # set to None if tax_options (nullable) is None + # and model_fields_set contains the field + if self.tax_options is None and "tax_options" in self.model_fields_set: + _dict['tax_options'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + # set to None if vat_identifier (nullable) is None + # and model_fields_set contains the field + if self.vat_identifier is None and "vat_identifier" in self.model_fields_set: + _dict['vat_identifier'] = None + + # set to None if zip_code (nullable) is None + # and model_fields_set contains the field + if self.zip_code is None and "zip_code" in self.model_fields_set: + _dict['zip_code'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Customer from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "acquire_options": obj.get("acquire_options"), + "additional_groups_ids": obj.get("additional_groups_ids"), + "bank_account": obj.get("bank_account"), + "bank_account_owner": obj.get("bank_account_owner"), + "bank_bic": obj.get("bank_bic"), + "bank_code": obj.get("bank_code"), + "bank_iban": obj.get("bank_iban"), + "bank_name": obj.get("bank_name"), + "birth_date": obj.get("birth_date"), + "cash_allowance": obj.get("cash_allowance"), + "cash_allowance_days": obj.get("cash_allowance_days"), + "cash_discount": obj.get("cash_discount"), + "cash_discount_type": obj.get("cash_discount_type"), + "city": obj.get("city"), + "state": obj.get("state"), + "company_name": obj.get("company_name"), + "country": obj.get("country"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "delivery_title": obj.get("delivery_title"), + "delivery_city": obj.get("delivery_city"), + "delivery_state": obj.get("delivery_state"), + "delivery_company_name": obj.get("delivery_company_name"), + "delivery_country": obj.get("delivery_country"), + "delivery_first_name": obj.get("delivery_first_name"), + "delivery_last_name": obj.get("delivery_last_name"), + "delivery_personal": obj.get("delivery_personal"), + "delivery_salutation": obj.get("delivery_salutation"), + "delivery_street": obj.get("delivery_street"), + "delivery_suffix_1": obj.get("delivery_suffix_1"), + "delivery_suffix_2": obj.get("delivery_suffix_2"), + "delivery_zip_code": obj.get("delivery_zip_code"), + "display_name": obj.get("display_name"), + "emails": obj.get("emails"), + "fax": obj.get("fax"), + "first_name": obj.get("first_name"), + "grace_period": obj.get("grace_period"), + "due_in_days": obj.get("due_in_days"), + "group_id": obj.get("group_id"), + "id": obj.get("id"), + "info_1": obj.get("info_1"), + "info_2": obj.get("info_2"), + "internet": obj.get("internet"), + "last_name": obj.get("last_name"), + "login_id": obj.get("login_id"), + "mobile": obj.get("mobile"), + "note": obj.get("note"), + "number": obj.get("number"), + "supplier_number": obj.get("supplier_number"), + "payment_options": obj.get("payment_options"), + "personal": obj.get("personal") if obj.get("personal") is not None else False, + "phone_1": obj.get("phone_1"), + "phone_2": obj.get("phone_2"), + "postbox": obj.get("postbox"), + "postbox_city": obj.get("postbox_city"), + "postbox_state": obj.get("postbox_state"), + "postbox_country": obj.get("postbox_country"), + "postbox_zip_code": obj.get("postbox_zip_code"), + "sale_price_level": obj.get("sale_price_level"), + "salutation": obj.get("salutation"), + "sepa_agreement": obj.get("sepa_agreement"), + "sepa_agreement_date": obj.get("sepa_agreement_date"), + "sepa_mandate_reference": obj.get("sepa_mandate_reference"), + "since_date": obj.get("since_date"), + "street": obj.get("street"), + "suffix_1": obj.get("suffix_1"), + "suffix_2": obj.get("suffix_2"), + "tax_number": obj.get("tax_number"), + "court": obj.get("court"), + "court_registry_number": obj.get("court_registry_number"), + "tax_options": obj.get("tax_options"), + "title": obj.get("title"), + "archived": obj.get("archived"), + "vat_identifier": obj.get("vat_identifier"), + "zip_code": obj.get("zip_code"), + "document_pdf_type": obj.get("document_pdf_type") if obj.get("document_pdf_type") is not None else 'default', + "buyer_reference": obj.get("buyer_reference"), + "foreign_supplier_number": obj.get("foreign_supplier_number") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/customer_group.py b/generated/sync/easybill_generated_sync/models/customer_group.py new file mode 100644 index 0000000..be07285 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/customer_group.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CustomerGroup(BaseModel): + """ + CustomerGroup + """ # noqa: E501 + name: StrictStr + description: Optional[StrictStr] = 'null' + number: StrictStr = Field(description="Can be chosen freely") + display_name: Optional[StrictStr] = None + id: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["name", "description", "number", "display_name", "id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CustomerGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "display_name", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CustomerGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "description": obj.get("description") if obj.get("description") is not None else 'null', + "number": obj.get("number"), + "display_name": obj.get("display_name"), + "id": obj.get("id") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/customer_groups.py b/generated/sync/easybill_generated_sync/models/customer_groups.py new file mode 100644 index 0000000..f160cf0 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/customer_groups.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.customer_group import CustomerGroup +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CustomerGroups(BaseModel): + """ + CustomerGroups + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[CustomerGroup]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CustomerGroups from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CustomerGroups from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [CustomerGroup.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/customer_snapshot.py b/generated/sync/easybill_generated_sync/models/customer_snapshot.py new file mode 100644 index 0000000..61f7bfd --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/customer_snapshot.py @@ -0,0 +1,577 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CustomerSnapshot(BaseModel): + """ + A snapshot of the customer model which belongs to a document. This model is readonly and the state is final after finalization of the document. It's is identical to the state of the customer model at the time of finalization. Updates to the actual customer dataset won't affect this snapshot, however if you update the document the customer and therefore the customer snapshot may reflect a different state. + """ # noqa: E501 + acquire_options: Optional[StrictInt] = Field(default=None, description="1 = Empfehlung eines anderen Kunden, 2 = Zeitungsanzeige, 3 = Eigene Akquisition, 4 = Mitarbeiter Akquisition, 5 = Google, 6 = Gelbe Seiten, 7 = Kostenlose Internet Plattform, 8 = Bezahlte Internet Plattform") + additional_groups_ids: Optional[List[StrictInt]] = None + bank_account: Optional[StrictStr] = None + bank_account_owner: Optional[StrictStr] = None + bank_bic: Optional[StrictStr] = None + bank_code: Optional[StrictStr] = None + bank_iban: Optional[StrictStr] = None + bank_name: Optional[StrictStr] = None + birth_date: Optional[date] = None + cash_allowance: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = None + cash_allowance_days: Optional[StrictInt] = None + cash_discount: Optional[Union[StrictFloat, StrictInt]] = None + cash_discount_type: Optional[StrictStr] = None + city: Optional[StrictStr] = None + state: Optional[StrictStr] = None + company_name: Optional[StrictStr] + country: Optional[StrictStr] = None + created_at: Optional[date] = None + updated_at: Optional[StrictStr] = None + delivery_title: Optional[StrictStr] = None + delivery_city: Optional[StrictStr] = None + delivery_state: Optional[StrictStr] = None + delivery_company_name: Optional[StrictStr] = None + delivery_country: Optional[StrictStr] = None + delivery_first_name: Optional[StrictStr] = None + delivery_last_name: Optional[StrictStr] = None + delivery_personal: Optional[StrictBool] = None + delivery_salutation: Optional[StrictInt] = Field(default=None, description="0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family") + delivery_street: Optional[StrictStr] = None + delivery_suffix_1: Optional[StrictStr] = None + delivery_suffix_2: Optional[StrictStr] = None + delivery_zip_code: Optional[StrictStr] = None + display_name: Optional[StrictStr] = None + emails: Optional[List[StrictStr]] = None + fax: Optional[StrictStr] = None + first_name: Optional[StrictStr] = None + grace_period: Optional[StrictInt] = Field(default=None, description="will be replaced by its alias due_in_days.") + due_in_days: Optional[StrictInt] = Field(default=None, description="due date in days") + group_id: Optional[StrictInt] = None + id: Optional[StrictInt] = None + info_1: Optional[StrictStr] = None + info_2: Optional[StrictStr] = None + internet: Optional[StrictStr] = None + last_name: Optional[StrictStr] + login_id: Optional[StrictInt] = None + mobile: Optional[StrictStr] = None + note: Optional[StrictStr] = None + number: Optional[StrictStr] = Field(default=None, description="Automatically generated if empty/omitted and when no type in query is provided or the type 'CUSTOMER', 'CUSTOMER,SUPPLIER'") + supplier_number: Optional[StrictStr] = Field(default=None, description="Automatically generated if the type SUPPLIER or 'CUSTOMER,SUPPLIER' is provided as query parameter and the field supplier_number is empty/omitted.") + payment_options: Optional[StrictInt] = Field(default=None, description="1 = Stets pünktliche Zahlung, 2 = überwiegend pünktliche Zahlung, 3 = überwiegend verspätete Zahlung, 5 = Grundsätzlich verspätete Zahlung") + personal: Optional[StrictBool] = False + phone_1: Optional[StrictStr] = None + phone_2: Optional[StrictStr] = None + postbox: Optional[StrictStr] = None + postbox_city: Optional[StrictStr] = None + postbox_state: Optional[StrictStr] = None + postbox_country: Optional[StrictStr] = None + postbox_zip_code: Optional[StrictStr] = None + sale_price_level: Optional[StrictStr] = None + salutation: Optional[StrictInt] = Field(default=None, description="0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family") + sepa_agreement: Optional[StrictStr] = Field(default=None, description="BASIC = SEPA-Basislastschrift, COR1 = SEPA-Basislastschrift COR1 (deprecated use BASIC instead), COMPANY = SEPA-Firmenlastschrift, NULL = Noch kein Mandat erteilt") + sepa_agreement_date: Optional[date] = None + sepa_mandate_reference: Optional[StrictStr] = None + since_date: Optional[date] = None + street: Optional[StrictStr] = None + suffix_1: Optional[StrictStr] = None + suffix_2: Optional[StrictStr] = None + tax_number: Optional[StrictStr] = None + court: Optional[StrictStr] = None + court_registry_number: Optional[StrictStr] = None + tax_options: Optional[StrictStr] = Field(default=None, description="nStb = Nicht steuerbar (Drittland), nStbUstID = Nicht steuerbar (EU mit USt-IdNr.), nStbNoneUstID = Nicht steuerbar (EU ohne USt-IdNr.), revc = Steuerschuldwechsel §13b (Inland), IG = Innergemeinschaftliche Lieferung, AL = Ausfuhrlieferung, sStfr = sonstige Steuerbefreiung, NULL = Umsatzsteuerpflichtig") + title: Optional[StrictStr] = None + archived: Optional[StrictBool] = None + vat_identifier: Optional[StrictStr] = None + zip_code: Optional[StrictStr] = None + document_pdf_type: Optional[StrictStr] = Field(default='default', description="Type of PDF to use when sending a Document to the Customer.") + buyer_reference: Optional[StrictStr] = Field(default=None, description="Used as \"buyerReference\" in ZUGFeRD and as \"Leitweg-ID\" in the XRechnung format.") + foreign_supplier_number: Optional[StrictStr] = Field(default=None, description="The ID given to your company by the customer in his system.") + __properties: ClassVar[List[str]] = ["acquire_options", "additional_groups_ids", "bank_account", "bank_account_owner", "bank_bic", "bank_code", "bank_iban", "bank_name", "birth_date", "cash_allowance", "cash_allowance_days", "cash_discount", "cash_discount_type", "city", "state", "company_name", "country", "created_at", "updated_at", "delivery_title", "delivery_city", "delivery_state", "delivery_company_name", "delivery_country", "delivery_first_name", "delivery_last_name", "delivery_personal", "delivery_salutation", "delivery_street", "delivery_suffix_1", "delivery_suffix_2", "delivery_zip_code", "display_name", "emails", "fax", "first_name", "grace_period", "due_in_days", "group_id", "id", "info_1", "info_2", "internet", "last_name", "login_id", "mobile", "note", "number", "supplier_number", "payment_options", "personal", "phone_1", "phone_2", "postbox", "postbox_city", "postbox_state", "postbox_country", "postbox_zip_code", "sale_price_level", "salutation", "sepa_agreement", "sepa_agreement_date", "sepa_mandate_reference", "since_date", "street", "suffix_1", "suffix_2", "tax_number", "court", "court_registry_number", "tax_options", "title", "archived", "vat_identifier", "zip_code", "document_pdf_type", "buyer_reference", "foreign_supplier_number"] + + @field_validator('cash_discount_type') + def cash_discount_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PERCENT', 'AMOUNT']): + raise ValueError("must be one of enum values ('PERCENT', 'AMOUNT')") + return value + + @field_validator('sale_price_level') + def sale_price_level_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['SALEPRICE2', 'SALEPRICE3', 'SALEPRICE4', 'SALEPRICE5', 'SALEPRICE6', 'SALEPRICE7', 'SALEPRICE8', 'SALEPRICE9', 'SALEPRICE10']): + raise ValueError("must be one of enum values ('SALEPRICE2', 'SALEPRICE3', 'SALEPRICE4', 'SALEPRICE5', 'SALEPRICE6', 'SALEPRICE7', 'SALEPRICE8', 'SALEPRICE9', 'SALEPRICE10')") + return value + + @field_validator('sepa_agreement') + def sepa_agreement_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['BASIC', 'COR1', 'COMPANY', 'NULL']): + raise ValueError("must be one of enum values ('BASIC', 'COR1', 'COMPANY', 'NULL')") + return value + + @field_validator('tax_options') + def tax_options_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['nStb', 'nStbUstID', 'nStbNoneUstID', 'nStbIm', 'revc', 'IG', 'AL', 'sStfr', 'NULL']): + raise ValueError("must be one of enum values ('nStb', 'nStbUstID', 'nStbNoneUstID', 'nStbIm', 'revc', 'IG', 'AL', 'sStfr', 'NULL')") + return value + + @field_validator('document_pdf_type') + def document_pdf_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung2_1_xml', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml']): + raise ValueError("must be one of enum values ('default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung2_1_xml', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CustomerSnapshot from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "updated_at", + "display_name", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if acquire_options (nullable) is None + # and model_fields_set contains the field + if self.acquire_options is None and "acquire_options" in self.model_fields_set: + _dict['acquire_options'] = None + + # set to None if bank_account (nullable) is None + # and model_fields_set contains the field + if self.bank_account is None and "bank_account" in self.model_fields_set: + _dict['bank_account'] = None + + # set to None if bank_account_owner (nullable) is None + # and model_fields_set contains the field + if self.bank_account_owner is None and "bank_account_owner" in self.model_fields_set: + _dict['bank_account_owner'] = None + + # set to None if bank_bic (nullable) is None + # and model_fields_set contains the field + if self.bank_bic is None and "bank_bic" in self.model_fields_set: + _dict['bank_bic'] = None + + # set to None if bank_code (nullable) is None + # and model_fields_set contains the field + if self.bank_code is None and "bank_code" in self.model_fields_set: + _dict['bank_code'] = None + + # set to None if bank_iban (nullable) is None + # and model_fields_set contains the field + if self.bank_iban is None and "bank_iban" in self.model_fields_set: + _dict['bank_iban'] = None + + # set to None if bank_name (nullable) is None + # and model_fields_set contains the field + if self.bank_name is None and "bank_name" in self.model_fields_set: + _dict['bank_name'] = None + + # set to None if birth_date (nullable) is None + # and model_fields_set contains the field + if self.birth_date is None and "birth_date" in self.model_fields_set: + _dict['birth_date'] = None + + # set to None if cash_allowance (nullable) is None + # and model_fields_set contains the field + if self.cash_allowance is None and "cash_allowance" in self.model_fields_set: + _dict['cash_allowance'] = None + + # set to None if cash_discount (nullable) is None + # and model_fields_set contains the field + if self.cash_discount is None and "cash_discount" in self.model_fields_set: + _dict['cash_discount'] = None + + # set to None if cash_discount_type (nullable) is None + # and model_fields_set contains the field + if self.cash_discount_type is None and "cash_discount_type" in self.model_fields_set: + _dict['cash_discount_type'] = None + + # set to None if city (nullable) is None + # and model_fields_set contains the field + if self.city is None and "city" in self.model_fields_set: + _dict['city'] = None + + # set to None if company_name (nullable) is None + # and model_fields_set contains the field + if self.company_name is None and "company_name" in self.model_fields_set: + _dict['company_name'] = None + + # set to None if delivery_city (nullable) is None + # and model_fields_set contains the field + if self.delivery_city is None and "delivery_city" in self.model_fields_set: + _dict['delivery_city'] = None + + # set to None if delivery_company_name (nullable) is None + # and model_fields_set contains the field + if self.delivery_company_name is None and "delivery_company_name" in self.model_fields_set: + _dict['delivery_company_name'] = None + + # set to None if delivery_country (nullable) is None + # and model_fields_set contains the field + if self.delivery_country is None and "delivery_country" in self.model_fields_set: + _dict['delivery_country'] = None + + # set to None if delivery_first_name (nullable) is None + # and model_fields_set contains the field + if self.delivery_first_name is None and "delivery_first_name" in self.model_fields_set: + _dict['delivery_first_name'] = None + + # set to None if delivery_last_name (nullable) is None + # and model_fields_set contains the field + if self.delivery_last_name is None and "delivery_last_name" in self.model_fields_set: + _dict['delivery_last_name'] = None + + # set to None if delivery_street (nullable) is None + # and model_fields_set contains the field + if self.delivery_street is None and "delivery_street" in self.model_fields_set: + _dict['delivery_street'] = None + + # set to None if delivery_suffix_1 (nullable) is None + # and model_fields_set contains the field + if self.delivery_suffix_1 is None and "delivery_suffix_1" in self.model_fields_set: + _dict['delivery_suffix_1'] = None + + # set to None if delivery_suffix_2 (nullable) is None + # and model_fields_set contains the field + if self.delivery_suffix_2 is None and "delivery_suffix_2" in self.model_fields_set: + _dict['delivery_suffix_2'] = None + + # set to None if delivery_zip_code (nullable) is None + # and model_fields_set contains the field + if self.delivery_zip_code is None and "delivery_zip_code" in self.model_fields_set: + _dict['delivery_zip_code'] = None + + # set to None if fax (nullable) is None + # and model_fields_set contains the field + if self.fax is None and "fax" in self.model_fields_set: + _dict['fax'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['first_name'] = None + + # set to None if grace_period (nullable) is None + # and model_fields_set contains the field + if self.grace_period is None and "grace_period" in self.model_fields_set: + _dict['grace_period'] = None + + # set to None if due_in_days (nullable) is None + # and model_fields_set contains the field + if self.due_in_days is None and "due_in_days" in self.model_fields_set: + _dict['due_in_days'] = None + + # set to None if group_id (nullable) is None + # and model_fields_set contains the field + if self.group_id is None and "group_id" in self.model_fields_set: + _dict['group_id'] = None + + # set to None if info_1 (nullable) is None + # and model_fields_set contains the field + if self.info_1 is None and "info_1" in self.model_fields_set: + _dict['info_1'] = None + + # set to None if info_2 (nullable) is None + # and model_fields_set contains the field + if self.info_2 is None and "info_2" in self.model_fields_set: + _dict['info_2'] = None + + # set to None if internet (nullable) is None + # and model_fields_set contains the field + if self.internet is None and "internet" in self.model_fields_set: + _dict['internet'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['last_name'] = None + + # set to None if mobile (nullable) is None + # and model_fields_set contains the field + if self.mobile is None and "mobile" in self.model_fields_set: + _dict['mobile'] = None + + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if payment_options (nullable) is None + # and model_fields_set contains the field + if self.payment_options is None and "payment_options" in self.model_fields_set: + _dict['payment_options'] = None + + # set to None if phone_1 (nullable) is None + # and model_fields_set contains the field + if self.phone_1 is None and "phone_1" in self.model_fields_set: + _dict['phone_1'] = None + + # set to None if phone_2 (nullable) is None + # and model_fields_set contains the field + if self.phone_2 is None and "phone_2" in self.model_fields_set: + _dict['phone_2'] = None + + # set to None if postbox (nullable) is None + # and model_fields_set contains the field + if self.postbox is None and "postbox" in self.model_fields_set: + _dict['postbox'] = None + + # set to None if postbox_city (nullable) is None + # and model_fields_set contains the field + if self.postbox_city is None and "postbox_city" in self.model_fields_set: + _dict['postbox_city'] = None + + # set to None if postbox_country (nullable) is None + # and model_fields_set contains the field + if self.postbox_country is None and "postbox_country" in self.model_fields_set: + _dict['postbox_country'] = None + + # set to None if postbox_zip_code (nullable) is None + # and model_fields_set contains the field + if self.postbox_zip_code is None and "postbox_zip_code" in self.model_fields_set: + _dict['postbox_zip_code'] = None + + # set to None if sale_price_level (nullable) is None + # and model_fields_set contains the field + if self.sale_price_level is None and "sale_price_level" in self.model_fields_set: + _dict['sale_price_level'] = None + + # set to None if sepa_agreement (nullable) is None + # and model_fields_set contains the field + if self.sepa_agreement is None and "sepa_agreement" in self.model_fields_set: + _dict['sepa_agreement'] = None + + # set to None if sepa_agreement_date (nullable) is None + # and model_fields_set contains the field + if self.sepa_agreement_date is None and "sepa_agreement_date" in self.model_fields_set: + _dict['sepa_agreement_date'] = None + + # set to None if sepa_mandate_reference (nullable) is None + # and model_fields_set contains the field + if self.sepa_mandate_reference is None and "sepa_mandate_reference" in self.model_fields_set: + _dict['sepa_mandate_reference'] = None + + # set to None if since_date (nullable) is None + # and model_fields_set contains the field + if self.since_date is None and "since_date" in self.model_fields_set: + _dict['since_date'] = None + + # set to None if street (nullable) is None + # and model_fields_set contains the field + if self.street is None and "street" in self.model_fields_set: + _dict['street'] = None + + # set to None if suffix_1 (nullable) is None + # and model_fields_set contains the field + if self.suffix_1 is None and "suffix_1" in self.model_fields_set: + _dict['suffix_1'] = None + + # set to None if suffix_2 (nullable) is None + # and model_fields_set contains the field + if self.suffix_2 is None and "suffix_2" in self.model_fields_set: + _dict['suffix_2'] = None + + # set to None if tax_number (nullable) is None + # and model_fields_set contains the field + if self.tax_number is None and "tax_number" in self.model_fields_set: + _dict['tax_number'] = None + + # set to None if court (nullable) is None + # and model_fields_set contains the field + if self.court is None and "court" in self.model_fields_set: + _dict['court'] = None + + # set to None if court_registry_number (nullable) is None + # and model_fields_set contains the field + if self.court_registry_number is None and "court_registry_number" in self.model_fields_set: + _dict['court_registry_number'] = None + + # set to None if tax_options (nullable) is None + # and model_fields_set contains the field + if self.tax_options is None and "tax_options" in self.model_fields_set: + _dict['tax_options'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + # set to None if vat_identifier (nullable) is None + # and model_fields_set contains the field + if self.vat_identifier is None and "vat_identifier" in self.model_fields_set: + _dict['vat_identifier'] = None + + # set to None if zip_code (nullable) is None + # and model_fields_set contains the field + if self.zip_code is None and "zip_code" in self.model_fields_set: + _dict['zip_code'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CustomerSnapshot from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "acquire_options": obj.get("acquire_options"), + "additional_groups_ids": obj.get("additional_groups_ids"), + "bank_account": obj.get("bank_account"), + "bank_account_owner": obj.get("bank_account_owner"), + "bank_bic": obj.get("bank_bic"), + "bank_code": obj.get("bank_code"), + "bank_iban": obj.get("bank_iban"), + "bank_name": obj.get("bank_name"), + "birth_date": obj.get("birth_date"), + "cash_allowance": obj.get("cash_allowance"), + "cash_allowance_days": obj.get("cash_allowance_days"), + "cash_discount": obj.get("cash_discount"), + "cash_discount_type": obj.get("cash_discount_type"), + "city": obj.get("city"), + "state": obj.get("state"), + "company_name": obj.get("company_name"), + "country": obj.get("country"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "delivery_title": obj.get("delivery_title"), + "delivery_city": obj.get("delivery_city"), + "delivery_state": obj.get("delivery_state"), + "delivery_company_name": obj.get("delivery_company_name"), + "delivery_country": obj.get("delivery_country"), + "delivery_first_name": obj.get("delivery_first_name"), + "delivery_last_name": obj.get("delivery_last_name"), + "delivery_personal": obj.get("delivery_personal"), + "delivery_salutation": obj.get("delivery_salutation"), + "delivery_street": obj.get("delivery_street"), + "delivery_suffix_1": obj.get("delivery_suffix_1"), + "delivery_suffix_2": obj.get("delivery_suffix_2"), + "delivery_zip_code": obj.get("delivery_zip_code"), + "display_name": obj.get("display_name"), + "emails": obj.get("emails"), + "fax": obj.get("fax"), + "first_name": obj.get("first_name"), + "grace_period": obj.get("grace_period"), + "due_in_days": obj.get("due_in_days"), + "group_id": obj.get("group_id"), + "id": obj.get("id"), + "info_1": obj.get("info_1"), + "info_2": obj.get("info_2"), + "internet": obj.get("internet"), + "last_name": obj.get("last_name"), + "login_id": obj.get("login_id"), + "mobile": obj.get("mobile"), + "note": obj.get("note"), + "number": obj.get("number"), + "supplier_number": obj.get("supplier_number"), + "payment_options": obj.get("payment_options"), + "personal": obj.get("personal") if obj.get("personal") is not None else False, + "phone_1": obj.get("phone_1"), + "phone_2": obj.get("phone_2"), + "postbox": obj.get("postbox"), + "postbox_city": obj.get("postbox_city"), + "postbox_state": obj.get("postbox_state"), + "postbox_country": obj.get("postbox_country"), + "postbox_zip_code": obj.get("postbox_zip_code"), + "sale_price_level": obj.get("sale_price_level"), + "salutation": obj.get("salutation"), + "sepa_agreement": obj.get("sepa_agreement"), + "sepa_agreement_date": obj.get("sepa_agreement_date"), + "sepa_mandate_reference": obj.get("sepa_mandate_reference"), + "since_date": obj.get("since_date"), + "street": obj.get("street"), + "suffix_1": obj.get("suffix_1"), + "suffix_2": obj.get("suffix_2"), + "tax_number": obj.get("tax_number"), + "court": obj.get("court"), + "court_registry_number": obj.get("court_registry_number"), + "tax_options": obj.get("tax_options"), + "title": obj.get("title"), + "archived": obj.get("archived"), + "vat_identifier": obj.get("vat_identifier"), + "zip_code": obj.get("zip_code"), + "document_pdf_type": obj.get("document_pdf_type") if obj.get("document_pdf_type") is not None else 'default', + "buyer_reference": obj.get("buyer_reference"), + "foreign_supplier_number": obj.get("foreign_supplier_number") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/customers.py b/generated/sync/easybill_generated_sync/models/customers.py new file mode 100644 index 0000000..fc75fcf --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/customers.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.customer import Customer +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Customers(BaseModel): + """ + Customers + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Customer]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Customers from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Customers from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Customer.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/discount.py b/generated/sync/easybill_generated_sync/models/discount.py new file mode 100644 index 0000000..0a1f9e1 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/discount.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Discount(BaseModel): + """ + Discount + """ # noqa: E501 + id: Optional[StrictInt] = None + customer_id: StrictInt + discount: Optional[StrictInt] = Field(default=None, description="The discount value depending on \"discount_type\". If not provided, inherits from customer when available") + discount_type: Optional[StrictStr] = Field(default='PERCENT', description="AMOUNT subtracts the value in \"discount\" from the total
QUANTITY subtracts the value in \"discount\" multiplied by quantity
PERCENT uses the value in \"discount\" as a percentage
FIX sets the value in \"discount\" as the new price. If not provided, inherits from customer when available") + __properties: ClassVar[List[str]] = ["id", "customer_id", "discount", "discount_type"] + + @field_validator('discount_type') + def discount_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AMOUNT', 'PERCENT', 'QUANTITY', 'FIX']): + raise ValueError("must be one of enum values ('AMOUNT', 'PERCENT', 'QUANTITY', 'FIX')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Discount from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Discount from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "customer_id": obj.get("customer_id"), + "discount": obj.get("discount"), + "discount_type": obj.get("discount_type") if obj.get("discount_type") is not None else 'PERCENT' + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/discount_position.py b/generated/sync/easybill_generated_sync/models/discount_position.py new file mode 100644 index 0000000..171c095 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/discount_position.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DiscountPosition(BaseModel): + """ + DiscountPosition + """ # noqa: E501 + id: Optional[StrictInt] = None + customer_id: StrictInt + discount: Optional[StrictInt] = Field(default=None, description="The discount value depending on \"discount_type\". If not provided, inherits from customer when available") + discount_type: Optional[StrictStr] = Field(default='PERCENT', description="AMOUNT subtracts the value in \"discount\" from the total
QUANTITY subtracts the value in \"discount\" multiplied by quantity
PERCENT uses the value in \"discount\" as a percentage
FIX sets the value in \"discount\" as the new price. If not provided, inherits from customer when available") + position_id: StrictInt + __properties: ClassVar[List[str]] = ["id", "customer_id", "discount", "discount_type", "position_id"] + + @field_validator('discount_type') + def discount_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AMOUNT', 'PERCENT', 'QUANTITY', 'FIX']): + raise ValueError("must be one of enum values ('AMOUNT', 'PERCENT', 'QUANTITY', 'FIX')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscountPosition from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiscountPosition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "customer_id": obj.get("customer_id"), + "discount": obj.get("discount"), + "discount_type": obj.get("discount_type") if obj.get("discount_type") is not None else 'PERCENT', + "position_id": obj.get("position_id") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/discount_position_group.py b/generated/sync/easybill_generated_sync/models/discount_position_group.py new file mode 100644 index 0000000..ead0c48 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/discount_position_group.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DiscountPositionGroup(BaseModel): + """ + DiscountPositionGroup + """ # noqa: E501 + id: Optional[StrictInt] = None + customer_id: StrictInt + discount: Optional[StrictInt] = Field(default=None, description="The discount value depending on \"discount_type\". If not provided, inherits from customer when available") + discount_type: Optional[StrictStr] = Field(default='PERCENT', description="AMOUNT subtracts the value in \"discount\" from the total
QUANTITY subtracts the value in \"discount\" multiplied by quantity
PERCENT uses the value in \"discount\" as a percentage
FIX sets the value in \"discount\" as the new price. If not provided, inherits from customer when available") + position_group_id: StrictInt + __properties: ClassVar[List[str]] = ["id", "customer_id", "discount", "discount_type", "position_group_id"] + + @field_validator('discount_type') + def discount_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['AMOUNT', 'PERCENT', 'QUANTITY', 'FIX']): + raise ValueError("must be one of enum values ('AMOUNT', 'PERCENT', 'QUANTITY', 'FIX')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscountPositionGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiscountPositionGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "customer_id": obj.get("customer_id"), + "discount": obj.get("discount"), + "discount_type": obj.get("discount_type") if obj.get("discount_type") is not None else 'PERCENT', + "position_group_id": obj.get("position_group_id") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/discount_position_groups.py b/generated/sync/easybill_generated_sync/models/discount_position_groups.py new file mode 100644 index 0000000..e134267 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/discount_position_groups.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.discount_position_group import DiscountPositionGroup +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DiscountPositionGroups(BaseModel): + """ + DiscountPositionGroups + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[DiscountPositionGroup]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscountPositionGroups from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiscountPositionGroups from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [DiscountPositionGroup.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/discount_positions.py b/generated/sync/easybill_generated_sync/models/discount_positions.py new file mode 100644 index 0000000..6189028 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/discount_positions.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.discount_position import DiscountPosition +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DiscountPositions(BaseModel): + """ + DiscountPositions + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[DiscountPosition]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscountPositions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiscountPositions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [DiscountPosition.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/document.py b/generated/sync/easybill_generated_sync/models/document.py new file mode 100644 index 0000000..8676c2f --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/document.py @@ -0,0 +1,491 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from easybill_generated_sync.models.advanced_data_field import AdvancedDataField +from easybill_generated_sync.models.customer_snapshot import CustomerSnapshot +from easybill_generated_sync.models.document_address import DocumentAddress +from easybill_generated_sync.models.document_position import DocumentPosition +from easybill_generated_sync.models.document_recurring import DocumentRecurring +from easybill_generated_sync.models.file_format_config import FileFormatConfig +from easybill_generated_sync.models.service_date import ServiceDate +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Document(BaseModel): + """ + Document + """ # noqa: E501 + address: Optional[DocumentAddress] = None + advanced_data_fields: Optional[List[AdvancedDataField]] = Field(default=None, description="EN16931 Business Terms (BT fields) for structured invoice data. On update the submitted list fully replaces the existing fields — send an empty array to clear all.") + attachment_ids: Optional[List[StrictInt]] = None + label_address: Optional[DocumentAddress] = None + amount: Optional[StrictInt] = Field(default=None, description="Amount in cents (e.g. \"150\" = 1.50€)") + amount_net: Optional[StrictInt] = Field(default=None, description="Amount in cents (e.g. \"150\" = 1.50€)") + anonymize_due_date: Optional[date] = Field(default=None, description="A date which signals when to anonymize the document. Must be in the future. Turns into a read only field if the document is anonymized") + anonymize_status: Optional[StrictStr] = Field(default='NOT_ANONYMIZED', description="This field signals if the document was anonymized") + anonymized_at: Optional[StrictStr] = None + bank_debit_form: Optional[StrictStr] = 'null' + billing_country: Optional[StrictStr] = None + calc_vat_from: Optional[StrictInt] = Field(default=None, description="0 === Net, 1 === Gross.") + cancel_id: Optional[StrictInt] = Field(default=None, description="ID from the cancel document. Only for document type INVOICE.") + cash_allowance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Cash allowance percentage. If not provided, inherits from customer when available.") + cash_allowance_days: Optional[StrictInt] = Field(default=None, description="Days for cash allowance. If not provided, inherits from customer when available.") + cash_allowance_text: Optional[StrictStr] = 'null' + contact_id: Optional[StrictInt] = None + contact_label: Optional[StrictStr] = '' + contact_text: Optional[StrictStr] = '' + created_at: Optional[datetime] = None + currency: Optional[StrictStr] = 'EUR' + customer_id: Optional[StrictInt] = None + customer_snapshot: Optional[CustomerSnapshot] = None + discount: Optional[StrictStr] = 'null' + discount_type: Optional[StrictStr] = null + document_date: Optional[date] = None + due_date: Optional[date] = Field(default=None, description="To change the value use grace_period.") + edited_at: Optional[datetime] = None + external_id: Optional[StrictStr] = 'null' + replica_url: Optional[StrictStr] = 'null' + grace_period: Optional[StrictInt] = Field(default=None, description="will be replaced by its alias due_in_days.") + due_in_days: Optional[StrictInt] = Field(default=None, description="due date in days. If not provided, inherits from customer when available") + id: Optional[StrictInt] = None + is_acceptable_on_public_domain: Optional[StrictBool] = Field(default=False, description="Indicates if a document can be accepted by the end customer through the document's public access page.") + is_archive: Optional[StrictBool] = False + is_draft: Optional[StrictBool] = Field(default=None, description="This property is read only. To finish the document call /documents/{id}/done.") + is_replica: Optional[StrictBool] = Field(default=False, description="Marks a document as a replica from another software.") + is_oss: Optional[StrictBool] = Field(default=False, description="Indicates if a document is a one-stop-shop document") + item_notes: Optional[List[StrictStr]] = Field(default=None, description="Field holds all unique document_note of items for the document") + items: Optional[List[DocumentPosition]] = None + last_postbox_id: Optional[StrictInt] = None + login_id: Optional[StrictInt] = Field(default=None, description="If omitted or null, the currently active login is used.") + number: Optional[StrictStr] = 'null' + order_number: Optional[StrictStr] = '' + buyer_reference: Optional[StrictStr] = '' + paid_amount: Optional[StrictInt] = None + paid_at: Optional[date] = None + pdf_pages: Optional[StrictInt] = None + pdf_template: Optional[StrictStr] = Field(default=None, description="Default template is null or 'DE', default english is 'EN' and for all others use the numeric template ID.") + payment_link_enabled: Optional[StrictBool] = Field(default=False, description="Whether the payment link is shown on this document. Overrides the setting from the referenced template.") + payment_link_locale: Optional[StrictStr] = Field(default='de', description="Language of the payment link text on the document.") + project_id: Optional[StrictInt] = None + recurring_options: Optional[DocumentRecurring] = None + ref_id: Optional[StrictInt] = Field(default=None, description="Reference document id") + root_id: Optional[StrictInt] = Field(default=None, description="Root document id") + service_date: Optional[ServiceDate] = None + shipping_country: Optional[StrictStr] = 'null' + status: Optional[StrictStr] = Field(default=null, description="This value can only be used in document type DELIVERY, ORDER, CHARGE or OFFER. NULL is default = not set.") + text: Optional[StrictStr] = None + text_prefix: Optional[StrictStr] = None + text_tax: Optional[StrictStr] = Field(default='null', description="Overwrites the default vat-option text from the document layout. It is only displayed in documents with the type other than: Delivery, Dunning, Reminder or Letter and a different vat-option than null") + title: Optional[StrictStr] = 'null' + type: Optional[StrictStr] = Field(default='INVOICE', description="Can only set on create.") + use_shipping_address: Optional[StrictBool] = Field(default=False, description="If true and customer has shipping address then it will be used.") + vat_country: Optional[StrictStr] = 'null' + vat_id: Optional[StrictStr] = '' + fulfillment_country: Optional[StrictStr] = 'null' + vat_option: Optional[StrictStr] = Field(default=null, description="NULL: Normal steuerbar
nStb: Nicht steuerbar (Drittland)
nStbUstID: Nicht steuerbar (EU mit USt-IdNr.)
nStbNoneUstID: Nicht steuerbar (EU ohne USt-IdNr.)
nStbIm: Nicht steuerbarer Innenumsatz
revc: Steuerschuldwechsel §13b (Inland)
IG: Innergemeinschaftliche Lieferung
AL: Ausfuhrlieferung
sStfr: sonstige Steuerbefreiung
smallBusiness: Kleinunternehmen (Keine MwSt.)") + file_format_config: Optional[List[FileFormatConfig]] = None + __properties: ClassVar[List[str]] = ["address", "advanced_data_fields", "attachment_ids", "label_address", "amount", "amount_net", "anonymize_due_date", "anonymize_status", "anonymized_at", "bank_debit_form", "billing_country", "calc_vat_from", "cancel_id", "cash_allowance", "cash_allowance_days", "cash_allowance_text", "contact_id", "contact_label", "contact_text", "created_at", "currency", "customer_id", "customer_snapshot", "discount", "discount_type", "document_date", "due_date", "edited_at", "external_id", "replica_url", "grace_period", "due_in_days", "id", "is_acceptable_on_public_domain", "is_archive", "is_draft", "is_replica", "is_oss", "item_notes", "items", "last_postbox_id", "login_id", "number", "order_number", "buyer_reference", "paid_amount", "paid_at", "pdf_pages", "pdf_template", "payment_link_enabled", "payment_link_locale", "project_id", "recurring_options", "ref_id", "root_id", "service_date", "shipping_country", "status", "text", "text_prefix", "text_tax", "title", "type", "use_shipping_address", "vat_country", "vat_id", "fulfillment_country", "vat_option", "file_format_config"] + + @field_validator('anonymize_status') + def anonymize_status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['NOT_ANONYMIZED', 'ANONYMIZED']): + raise ValueError("must be one of enum values ('NOT_ANONYMIZED', 'ANONYMIZED')") + return value + + @field_validator('discount_type') + def discount_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PERCENT', 'AMOUNT']): + raise ValueError("must be one of enum values ('PERCENT', 'AMOUNT')") + return value + + @field_validator('payment_link_locale') + def payment_link_locale_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['de', 'en']): + raise ValueError("must be one of enum values ('de', 'en')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ACCEPT', 'DONE', 'DROPSHIPPING', 'CANCEL']): + raise ValueError("must be one of enum values ('ACCEPT', 'DONE', 'DROPSHIPPING', 'CANCEL')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['INVOICE', 'RECURRING', 'CREDIT', 'OFFER', 'REMINDER', 'DUNNING', 'STORNO', 'STORNO_CREDIT', 'DELIVERY', 'PDF', 'CHARGE', 'CHARGE_CONFIRM', 'LETTER', 'ORDER', 'PROFORMA_INVOICE', 'STORNO_PROFORMA_INVOICE']): + raise ValueError("must be one of enum values ('INVOICE', 'RECURRING', 'CREDIT', 'OFFER', 'REMINDER', 'DUNNING', 'STORNO', 'STORNO_CREDIT', 'DELIVERY', 'PDF', 'CHARGE', 'CHARGE_CONFIRM', 'LETTER', 'ORDER', 'PROFORMA_INVOICE', 'STORNO_PROFORMA_INVOICE')") + return value + + @field_validator('vat_option') + def vat_option_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['NULL', 'nStb', 'nStbUstID', 'nStbNoneUstID', 'nStbIm', 'revc', 'IG', 'AL', 'sStfr', 'smallBusiness']): + raise ValueError("must be one of enum values ('NULL', 'nStb', 'nStbUstID', 'nStbNoneUstID', 'nStbIm', 'revc', 'IG', 'AL', 'sStfr', 'smallBusiness')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Document from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "attachment_ids", + "amount", + "amount_net", + "anonymize_status", + "anonymized_at", + "billing_country", + "cancel_id", + "created_at", + "due_date", + "edited_at", + "id", + "is_draft", + "item_notes", + "last_postbox_id", + "paid_amount", + "paid_at", + "pdf_pages", + "root_id", + "vat_id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of address + if self.address: + _dict['address'] = self.address.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in advanced_data_fields (list) + _items = [] + if self.advanced_data_fields: + for _item_advanced_data_fields in self.advanced_data_fields: + if _item_advanced_data_fields: + _items.append(_item_advanced_data_fields.to_dict()) + _dict['advanced_data_fields'] = _items + # override the default output from pydantic by calling `to_dict()` of label_address + if self.label_address: + _dict['label_address'] = self.label_address.to_dict() + # override the default output from pydantic by calling `to_dict()` of customer_snapshot + if self.customer_snapshot: + _dict['customer_snapshot'] = self.customer_snapshot.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + # override the default output from pydantic by calling `to_dict()` of recurring_options + if self.recurring_options: + _dict['recurring_options'] = self.recurring_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of service_date + if self.service_date: + _dict['service_date'] = self.service_date.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in file_format_config (list) + _items = [] + if self.file_format_config: + for _item_file_format_config in self.file_format_config: + if _item_file_format_config: + _items.append(_item_file_format_config.to_dict()) + _dict['file_format_config'] = _items + # set to None if anonymize_due_date (nullable) is None + # and model_fields_set contains the field + if self.anonymize_due_date is None and "anonymize_due_date" in self.model_fields_set: + _dict['anonymize_due_date'] = None + + # set to None if anonymized_at (nullable) is None + # and model_fields_set contains the field + if self.anonymized_at is None and "anonymized_at" in self.model_fields_set: + _dict['anonymized_at'] = None + + # set to None if bank_debit_form (nullable) is None + # and model_fields_set contains the field + if self.bank_debit_form is None and "bank_debit_form" in self.model_fields_set: + _dict['bank_debit_form'] = None + + # set to None if cash_allowance (nullable) is None + # and model_fields_set contains the field + if self.cash_allowance is None and "cash_allowance" in self.model_fields_set: + _dict['cash_allowance'] = None + + # set to None if cash_allowance_days (nullable) is None + # and model_fields_set contains the field + if self.cash_allowance_days is None and "cash_allowance_days" in self.model_fields_set: + _dict['cash_allowance_days'] = None + + # set to None if cash_allowance_text (nullable) is None + # and model_fields_set contains the field + if self.cash_allowance_text is None and "cash_allowance_text" in self.model_fields_set: + _dict['cash_allowance_text'] = None + + # set to None if contact_id (nullable) is None + # and model_fields_set contains the field + if self.contact_id is None and "contact_id" in self.model_fields_set: + _dict['contact_id'] = None + + # set to None if customer_id (nullable) is None + # and model_fields_set contains the field + if self.customer_id is None and "customer_id" in self.model_fields_set: + _dict['customer_id'] = None + + # set to None if discount (nullable) is None + # and model_fields_set contains the field + if self.discount is None and "discount" in self.model_fields_set: + _dict['discount'] = None + + # set to None if discount_type (nullable) is None + # and model_fields_set contains the field + if self.discount_type is None and "discount_type" in self.model_fields_set: + _dict['discount_type'] = None + + # set to None if external_id (nullable) is None + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: + _dict['external_id'] = None + + # set to None if replica_url (nullable) is None + # and model_fields_set contains the field + if self.replica_url is None and "replica_url" in self.model_fields_set: + _dict['replica_url'] = None + + # set to None if grace_period (nullable) is None + # and model_fields_set contains the field + if self.grace_period is None and "grace_period" in self.model_fields_set: + _dict['grace_period'] = None + + # set to None if due_in_days (nullable) is None + # and model_fields_set contains the field + if self.due_in_days is None and "due_in_days" in self.model_fields_set: + _dict['due_in_days'] = None + + # set to None if number (nullable) is None + # and model_fields_set contains the field + if self.number is None and "number" in self.model_fields_set: + _dict['number'] = None + + # set to None if project_id (nullable) is None + # and model_fields_set contains the field + if self.project_id is None and "project_id" in self.model_fields_set: + _dict['project_id'] = None + + # set to None if ref_id (nullable) is None + # and model_fields_set contains the field + if self.ref_id is None and "ref_id" in self.model_fields_set: + _dict['ref_id'] = None + + # set to None if root_id (nullable) is None + # and model_fields_set contains the field + if self.root_id is None and "root_id" in self.model_fields_set: + _dict['root_id'] = None + + # set to None if shipping_country (nullable) is None + # and model_fields_set contains the field + if self.shipping_country is None and "shipping_country" in self.model_fields_set: + _dict['shipping_country'] = None + + # set to None if status (nullable) is None + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: + _dict['status'] = None + + # set to None if text_tax (nullable) is None + # and model_fields_set contains the field + if self.text_tax is None and "text_tax" in self.model_fields_set: + _dict['text_tax'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + # set to None if vat_country (nullable) is None + # and model_fields_set contains the field + if self.vat_country is None and "vat_country" in self.model_fields_set: + _dict['vat_country'] = None + + # set to None if fulfillment_country (nullable) is None + # and model_fields_set contains the field + if self.fulfillment_country is None and "fulfillment_country" in self.model_fields_set: + _dict['fulfillment_country'] = None + + # set to None if vat_option (nullable) is None + # and model_fields_set contains the field + if self.vat_option is None and "vat_option" in self.model_fields_set: + _dict['vat_option'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Document from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": DocumentAddress.from_dict(obj["address"]) if obj.get("address") is not None else None, + "advanced_data_fields": [AdvancedDataField.from_dict(_item) for _item in obj["advanced_data_fields"]] if obj.get("advanced_data_fields") is not None else None, + "attachment_ids": obj.get("attachment_ids"), + "label_address": DocumentAddress.from_dict(obj["label_address"]) if obj.get("label_address") is not None else None, + "amount": obj.get("amount"), + "amount_net": obj.get("amount_net"), + "anonymize_due_date": obj.get("anonymize_due_date"), + "anonymize_status": obj.get("anonymize_status") if obj.get("anonymize_status") is not None else 'NOT_ANONYMIZED', + "anonymized_at": obj.get("anonymized_at"), + "bank_debit_form": obj.get("bank_debit_form") if obj.get("bank_debit_form") is not None else 'null', + "billing_country": obj.get("billing_country"), + "calc_vat_from": obj.get("calc_vat_from"), + "cancel_id": obj.get("cancel_id"), + "cash_allowance": obj.get("cash_allowance"), + "cash_allowance_days": obj.get("cash_allowance_days"), + "cash_allowance_text": obj.get("cash_allowance_text") if obj.get("cash_allowance_text") is not None else 'null', + "contact_id": obj.get("contact_id"), + "contact_label": obj.get("contact_label") if obj.get("contact_label") is not None else '', + "contact_text": obj.get("contact_text") if obj.get("contact_text") is not None else '', + "created_at": obj.get("created_at"), + "currency": obj.get("currency") if obj.get("currency") is not None else 'EUR', + "customer_id": obj.get("customer_id"), + "customer_snapshot": CustomerSnapshot.from_dict(obj["customer_snapshot"]) if obj.get("customer_snapshot") is not None else None, + "discount": obj.get("discount") if obj.get("discount") is not None else 'null', + "discount_type": obj.get("discount_type") if obj.get("discount_type") is not None else null, + "document_date": obj.get("document_date"), + "due_date": obj.get("due_date"), + "edited_at": obj.get("edited_at"), + "external_id": obj.get("external_id") if obj.get("external_id") is not None else 'null', + "replica_url": obj.get("replica_url") if obj.get("replica_url") is not None else 'null', + "grace_period": obj.get("grace_period"), + "due_in_days": obj.get("due_in_days"), + "id": obj.get("id"), + "is_acceptable_on_public_domain": obj.get("is_acceptable_on_public_domain") if obj.get("is_acceptable_on_public_domain") is not None else False, + "is_archive": obj.get("is_archive") if obj.get("is_archive") is not None else False, + "is_draft": obj.get("is_draft"), + "is_replica": obj.get("is_replica") if obj.get("is_replica") is not None else False, + "is_oss": obj.get("is_oss") if obj.get("is_oss") is not None else False, + "item_notes": obj.get("item_notes"), + "items": [DocumentPosition.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "last_postbox_id": obj.get("last_postbox_id"), + "login_id": obj.get("login_id"), + "number": obj.get("number") if obj.get("number") is not None else 'null', + "order_number": obj.get("order_number") if obj.get("order_number") is not None else '', + "buyer_reference": obj.get("buyer_reference") if obj.get("buyer_reference") is not None else '', + "paid_amount": obj.get("paid_amount"), + "paid_at": obj.get("paid_at"), + "pdf_pages": obj.get("pdf_pages"), + "pdf_template": obj.get("pdf_template"), + "payment_link_enabled": obj.get("payment_link_enabled") if obj.get("payment_link_enabled") is not None else False, + "payment_link_locale": obj.get("payment_link_locale") if obj.get("payment_link_locale") is not None else 'de', + "project_id": obj.get("project_id"), + "recurring_options": DocumentRecurring.from_dict(obj["recurring_options"]) if obj.get("recurring_options") is not None else None, + "ref_id": obj.get("ref_id"), + "root_id": obj.get("root_id"), + "service_date": ServiceDate.from_dict(obj["service_date"]) if obj.get("service_date") is not None else None, + "shipping_country": obj.get("shipping_country") if obj.get("shipping_country") is not None else 'null', + "status": obj.get("status") if obj.get("status") is not None else null, + "text": obj.get("text"), + "text_prefix": obj.get("text_prefix"), + "text_tax": obj.get("text_tax") if obj.get("text_tax") is not None else 'null', + "title": obj.get("title") if obj.get("title") is not None else 'null', + "type": obj.get("type") if obj.get("type") is not None else 'INVOICE', + "use_shipping_address": obj.get("use_shipping_address") if obj.get("use_shipping_address") is not None else False, + "vat_country": obj.get("vat_country") if obj.get("vat_country") is not None else 'null', + "vat_id": obj.get("vat_id") if obj.get("vat_id") is not None else '', + "fulfillment_country": obj.get("fulfillment_country") if obj.get("fulfillment_country") is not None else 'null', + "vat_option": obj.get("vat_option") if obj.get("vat_option") is not None else null, + "file_format_config": [FileFormatConfig.from_dict(_item) for _item in obj["file_format_config"]] if obj.get("file_format_config") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/document_address.py b/generated/sync/easybill_generated_sync/models/document_address.py new file mode 100644 index 0000000..6e19180 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/document_address.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentAddress(BaseModel): + """ + This information comes from the customer which can be set with customer_id. + """ # noqa: E501 + salutation: Optional[StrictInt] = Field(default=None, description="0: empty
1: Herrn
2: Frau
3: Firma
4: Herrn und Frau
5: Eheleute
6: Familie") + personal: Optional[StrictBool] = None + title: Optional[StrictStr] = None + first_name: Optional[StrictStr] = None + last_name: Optional[StrictStr] = None + suffix_1: Optional[StrictStr] = None + suffix_2: Optional[StrictStr] = None + company_name: Optional[StrictStr] = None + street: Optional[StrictStr] = None + zip_code: Optional[StrictStr] = None + city: Optional[StrictStr] = None + state: Optional[StrictStr] = None + country: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["salutation", "personal", "title", "first_name", "last_name", "suffix_1", "suffix_2", "company_name", "street", "zip_code", "city", "state", "country"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentAddress from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "salutation", + "personal", + "title", + "first_name", + "last_name", + "suffix_1", + "suffix_2", + "company_name", + "street", + "zip_code", + "city", + "state", + "country", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentAddress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "salutation": obj.get("salutation"), + "personal": obj.get("personal"), + "title": obj.get("title"), + "first_name": obj.get("first_name"), + "last_name": obj.get("last_name"), + "suffix_1": obj.get("suffix_1"), + "suffix_2": obj.get("suffix_2"), + "company_name": obj.get("company_name"), + "street": obj.get("street"), + "zip_code": obj.get("zip_code"), + "city": obj.get("city"), + "state": obj.get("state"), + "country": obj.get("country") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/document_payment.py b/generated/sync/easybill_generated_sync/models/document_payment.py new file mode 100644 index 0000000..5f5d6c3 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/document_payment.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentPayment(BaseModel): + """ + DocumentPayment + """ # noqa: E501 + amount: StrictInt + document_id: StrictInt + id: Optional[StrictInt] = None + is_overdue_fee: Optional[StrictBool] = None + login_id: Optional[StrictInt] = None + notice: Optional[StrictStr] = '' + payment_at: Optional[date] = None + type: Optional[Annotated[str, Field(strict=True, max_length=255)]] = '' + provider: Optional[Annotated[str, Field(strict=True, max_length=255)]] = '' + reference: Optional[Annotated[str, Field(strict=True, max_length=255)]] = '' + __properties: ClassVar[List[str]] = ["amount", "document_id", "id", "is_overdue_fee", "login_id", "notice", "payment_at", "type", "provider", "reference"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentPayment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "login_id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentPayment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "amount": obj.get("amount"), + "document_id": obj.get("document_id"), + "id": obj.get("id"), + "is_overdue_fee": obj.get("is_overdue_fee"), + "login_id": obj.get("login_id"), + "notice": obj.get("notice") if obj.get("notice") is not None else '', + "payment_at": obj.get("payment_at"), + "type": obj.get("type") if obj.get("type") is not None else '', + "provider": obj.get("provider") if obj.get("provider") is not None else '', + "reference": obj.get("reference") if obj.get("reference") is not None else '' + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/document_payments.py b/generated/sync/easybill_generated_sync/models/document_payments.py new file mode 100644 index 0000000..c609920 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/document_payments.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.document_payment import DocumentPayment +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentPayments(BaseModel): + """ + DocumentPayments + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[DocumentPayment]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentPayments from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentPayments from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [DocumentPayment.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/document_position.py b/generated/sync/easybill_generated_sync/models/document_position.py new file mode 100644 index 0000000..05348eb --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/document_position.py @@ -0,0 +1,256 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentPosition(BaseModel): + """ + DocumentPosition + """ # noqa: E501 + number: Optional[StrictStr] = 'null' + description: Optional[StrictStr] = 'null' + document_note: Optional[StrictStr] = Field(default=None, description="This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction.") + quantity: Optional[Union[StrictFloat, StrictInt]] = 1.0 + quantity_str: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="Use quantity_str if you want to set a quantity like: 1:30 h or 3x5 m. quantity_str overwrites quantity.") + unit: Optional[StrictStr] = 'null' + type: Optional[StrictStr] = 'POSITION' + position: Optional[StrictInt] = Field(default=None, description="Automatic by default (first item: 1, second item: 2, ...)") + single_price_net: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)") + single_price_gross: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)") + vat_percent: Optional[Union[StrictFloat, StrictInt]] = 0.0 + discount: Optional[Union[StrictFloat, StrictInt]] = None + discount_type: Optional[StrictStr] = null + position_id: Optional[StrictInt] = Field(default=None, description="If set, values are copied from the referenced position") + total_price_net: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)") + total_price_gross: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)") + total_vat: Optional[Union[StrictFloat, StrictInt]] = None + serial_number_id: Optional[StrictStr] = None + serial_number: Optional[StrictStr] = None + booking_account: Optional[StrictStr] = 'null' + export_cost_1: Optional[StrictStr] = 'null' + export_cost_2: Optional[StrictStr] = 'null' + cost_price_net: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)") + cost_price_total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)") + cost_price_charge: Optional[Union[StrictFloat, StrictInt]] = None + cost_price_charge_type: Optional[StrictStr] = None + item_type: Optional[StrictStr] = Field(default='UNDEFINED', alias="itemType") + id: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["number", "description", "document_note", "quantity", "quantity_str", "unit", "type", "position", "single_price_net", "single_price_gross", "vat_percent", "discount", "discount_type", "position_id", "total_price_net", "total_price_gross", "total_vat", "serial_number_id", "serial_number", "booking_account", "export_cost_1", "export_cost_2", "cost_price_net", "cost_price_total", "cost_price_charge", "cost_price_charge_type", "itemType", "id"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['POSITION', 'POSITION_NOCALC', 'TEXT']): + raise ValueError("must be one of enum values ('POSITION', 'POSITION_NOCALC', 'TEXT')") + return value + + @field_validator('discount_type') + def discount_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PERCENT', 'AMOUNT', 'QUANTITY', 'FIX']): + raise ValueError("must be one of enum values ('PERCENT', 'AMOUNT', 'QUANTITY', 'FIX')") + return value + + @field_validator('cost_price_charge_type') + def cost_price_charge_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PERCENT', 'AMOUNT']): + raise ValueError("must be one of enum values ('PERCENT', 'AMOUNT')") + return value + + @field_validator('item_type') + def item_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PRODUCT', 'SERVICE', 'UNDEFINED']): + raise ValueError("must be one of enum values ('PRODUCT', 'SERVICE', 'UNDEFINED')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentPosition from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "total_price_net", + "total_price_gross", + "total_vat", + "serial_number_id", + "serial_number", + "cost_price_total", + "cost_price_charge", + "cost_price_charge_type", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if number (nullable) is None + # and model_fields_set contains the field + if self.number is None and "number" in self.model_fields_set: + _dict['number'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if unit (nullable) is None + # and model_fields_set contains the field + if self.unit is None and "unit" in self.model_fields_set: + _dict['unit'] = None + + # set to None if single_price_net (nullable) is None + # and model_fields_set contains the field + if self.single_price_net is None and "single_price_net" in self.model_fields_set: + _dict['single_price_net'] = None + + # set to None if discount (nullable) is None + # and model_fields_set contains the field + if self.discount is None and "discount" in self.model_fields_set: + _dict['discount'] = None + + # set to None if discount_type (nullable) is None + # and model_fields_set contains the field + if self.discount_type is None and "discount_type" in self.model_fields_set: + _dict['discount_type'] = None + + # set to None if position_id (nullable) is None + # and model_fields_set contains the field + if self.position_id is None and "position_id" in self.model_fields_set: + _dict['position_id'] = None + + # set to None if booking_account (nullable) is None + # and model_fields_set contains the field + if self.booking_account is None and "booking_account" in self.model_fields_set: + _dict['booking_account'] = None + + # set to None if export_cost_1 (nullable) is None + # and model_fields_set contains the field + if self.export_cost_1 is None and "export_cost_1" in self.model_fields_set: + _dict['export_cost_1'] = None + + # set to None if export_cost_2 (nullable) is None + # and model_fields_set contains the field + if self.export_cost_2 is None and "export_cost_2" in self.model_fields_set: + _dict['export_cost_2'] = None + + # set to None if cost_price_net (nullable) is None + # and model_fields_set contains the field + if self.cost_price_net is None and "cost_price_net" in self.model_fields_set: + _dict['cost_price_net'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentPosition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "number": obj.get("number") if obj.get("number") is not None else 'null', + "description": obj.get("description") if obj.get("description") is not None else 'null', + "document_note": obj.get("document_note"), + "quantity": obj.get("quantity") if obj.get("quantity") is not None else 1.0, + "quantity_str": obj.get("quantity_str"), + "unit": obj.get("unit") if obj.get("unit") is not None else 'null', + "type": obj.get("type") if obj.get("type") is not None else 'POSITION', + "position": obj.get("position"), + "single_price_net": obj.get("single_price_net"), + "single_price_gross": obj.get("single_price_gross"), + "vat_percent": obj.get("vat_percent") if obj.get("vat_percent") is not None else 0.0, + "discount": obj.get("discount"), + "discount_type": obj.get("discount_type") if obj.get("discount_type") is not None else null, + "position_id": obj.get("position_id"), + "total_price_net": obj.get("total_price_net"), + "total_price_gross": obj.get("total_price_gross"), + "total_vat": obj.get("total_vat"), + "serial_number_id": obj.get("serial_number_id"), + "serial_number": obj.get("serial_number"), + "booking_account": obj.get("booking_account") if obj.get("booking_account") is not None else 'null', + "export_cost_1": obj.get("export_cost_1") if obj.get("export_cost_1") is not None else 'null', + "export_cost_2": obj.get("export_cost_2") if obj.get("export_cost_2") is not None else 'null', + "cost_price_net": obj.get("cost_price_net"), + "cost_price_total": obj.get("cost_price_total"), + "cost_price_charge": obj.get("cost_price_charge"), + "cost_price_charge_type": obj.get("cost_price_charge_type"), + "itemType": obj.get("itemType") if obj.get("itemType") is not None else 'UNDEFINED', + "id": obj.get("id") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/document_recurring.py b/generated/sync/easybill_generated_sync/models/document_recurring.py new file mode 100644 index 0000000..3157e16 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/document_recurring.py @@ -0,0 +1,238 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentRecurring(BaseModel): + """ + This object is only available in document type RECURRING. + """ # noqa: E501 + next_date: date = Field(description="Must be in the future") + frequency: Optional[StrictStr] = 'MONTHLY' + frequency_special: Optional[StrictStr] = null + interval: Optional[StrictInt] = None + end_date_or_count: Optional[StrictStr] = Field(default='null', description="Date of last exectution day or number of times to exectute") + status: Optional[StrictStr] = 'WAITING' + as_draft: Optional[StrictBool] = False + is_notify: Optional[StrictBool] = False + send_as: Optional[StrictStr] = null + is_sign: Optional[StrictBool] = False + is_paid: Optional[StrictBool] = False + paid_date_option: Optional[StrictStr] = Field(default='created_date', description="Option is used to determine what date is used for the payment if is_paid is true. \"next_valid_date\" selects the next workday in regards to the created date of the document if the date falls on a saturday or sunday.") + is_sepa: Optional[StrictBool] = False + sepa_local_instrument: Optional[StrictStr] = Field(default=null, description="COR1 is deprecated use CORE instead.") + sepa_sequence_type: Optional[StrictStr] = null + sepa_reference: Optional[StrictStr] = 'null' + sepa_remittance_information: Optional[StrictStr] = 'null' + target_type: Optional[StrictStr] = Field(default='INVOICE', description="The document type that will be generated. Can not be changed on existing documents.") + __properties: ClassVar[List[str]] = ["next_date", "frequency", "frequency_special", "interval", "end_date_or_count", "status", "as_draft", "is_notify", "send_as", "is_sign", "is_paid", "paid_date_option", "is_sepa", "sepa_local_instrument", "sepa_sequence_type", "sepa_reference", "sepa_remittance_information", "target_type"] + + @field_validator('frequency') + def frequency_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['DAILY', 'WEEKLY', 'MONTHLY', 'YEARLY']): + raise ValueError("must be one of enum values ('DAILY', 'WEEKLY', 'MONTHLY', 'YEARLY')") + return value + + @field_validator('frequency_special') + def frequency_special_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['LASTDAYOFMONTH']): + raise ValueError("must be one of enum values ('LASTDAYOFMONTH')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['RUNNING', 'PAUSE', 'STOP', 'WAITING']): + raise ValueError("must be one of enum values ('RUNNING', 'PAUSE', 'STOP', 'WAITING')") + return value + + @field_validator('send_as') + def send_as_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['EMAIL', 'FAX', 'POST']): + raise ValueError("must be one of enum values ('EMAIL', 'FAX', 'POST')") + return value + + @field_validator('paid_date_option') + def paid_date_option_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['created_date', 'due_date', 'next_valid_date']): + raise ValueError("must be one of enum values ('created_date', 'due_date', 'next_valid_date')") + return value + + @field_validator('sepa_local_instrument') + def sepa_local_instrument_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['CORE', 'COR1', 'B2B']): + raise ValueError("must be one of enum values ('CORE', 'COR1', 'B2B')") + return value + + @field_validator('sepa_sequence_type') + def sepa_sequence_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['FRST', 'OOFF', 'FNAL', 'RCUR']): + raise ValueError("must be one of enum values ('FRST', 'OOFF', 'FNAL', 'RCUR')") + return value + + @field_validator('target_type') + def target_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['INVOICE', 'CREDIT', 'ORDER', 'OFFER']): + raise ValueError("must be one of enum values ('INVOICE', 'CREDIT', 'ORDER', 'OFFER')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentRecurring from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if frequency_special (nullable) is None + # and model_fields_set contains the field + if self.frequency_special is None and "frequency_special" in self.model_fields_set: + _dict['frequency_special'] = None + + # set to None if end_date_or_count (nullable) is None + # and model_fields_set contains the field + if self.end_date_or_count is None and "end_date_or_count" in self.model_fields_set: + _dict['end_date_or_count'] = None + + # set to None if send_as (nullable) is None + # and model_fields_set contains the field + if self.send_as is None and "send_as" in self.model_fields_set: + _dict['send_as'] = None + + # set to None if sepa_local_instrument (nullable) is None + # and model_fields_set contains the field + if self.sepa_local_instrument is None and "sepa_local_instrument" in self.model_fields_set: + _dict['sepa_local_instrument'] = None + + # set to None if sepa_sequence_type (nullable) is None + # and model_fields_set contains the field + if self.sepa_sequence_type is None and "sepa_sequence_type" in self.model_fields_set: + _dict['sepa_sequence_type'] = None + + # set to None if sepa_reference (nullable) is None + # and model_fields_set contains the field + if self.sepa_reference is None and "sepa_reference" in self.model_fields_set: + _dict['sepa_reference'] = None + + # set to None if sepa_remittance_information (nullable) is None + # and model_fields_set contains the field + if self.sepa_remittance_information is None and "sepa_remittance_information" in self.model_fields_set: + _dict['sepa_remittance_information'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentRecurring from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "next_date": obj.get("next_date"), + "frequency": obj.get("frequency") if obj.get("frequency") is not None else 'MONTHLY', + "frequency_special": obj.get("frequency_special") if obj.get("frequency_special") is not None else null, + "interval": obj.get("interval"), + "end_date_or_count": obj.get("end_date_or_count") if obj.get("end_date_or_count") is not None else 'null', + "status": obj.get("status") if obj.get("status") is not None else 'WAITING', + "as_draft": obj.get("as_draft") if obj.get("as_draft") is not None else False, + "is_notify": obj.get("is_notify") if obj.get("is_notify") is not None else False, + "send_as": obj.get("send_as") if obj.get("send_as") is not None else null, + "is_sign": obj.get("is_sign") if obj.get("is_sign") is not None else False, + "is_paid": obj.get("is_paid") if obj.get("is_paid") is not None else False, + "paid_date_option": obj.get("paid_date_option") if obj.get("paid_date_option") is not None else 'created_date', + "is_sepa": obj.get("is_sepa") if obj.get("is_sepa") is not None else False, + "sepa_local_instrument": obj.get("sepa_local_instrument") if obj.get("sepa_local_instrument") is not None else null, + "sepa_sequence_type": obj.get("sepa_sequence_type") if obj.get("sepa_sequence_type") is not None else null, + "sepa_reference": obj.get("sepa_reference") if obj.get("sepa_reference") is not None else 'null', + "sepa_remittance_information": obj.get("sepa_remittance_information") if obj.get("sepa_remittance_information") is not None else 'null', + "target_type": obj.get("target_type") if obj.get("target_type") is not None else 'INVOICE' + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/document_version.py b/generated/sync/easybill_generated_sync/models/document_version.py new file mode 100644 index 0000000..338469c --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/document_version.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.document_version_item import DocumentVersionItem +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentVersion(BaseModel): + """ + DocumentVersion + """ # noqa: E501 + created_at: Optional[datetime] = None + document_id: Optional[StrictInt] = None + id: Optional[StrictInt] = None + items: Optional[List[DocumentVersionItem]] = None + reason: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["created_at", "document_id", "id", "items", "reason"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentVersion from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "document_id", + "id", + "reason", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentVersion from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "document_id": obj.get("document_id"), + "id": obj.get("id"), + "items": [DocumentVersionItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, + "reason": obj.get("reason") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/document_version_item.py b/generated/sync/easybill_generated_sync/models/document_version_item.py new file mode 100644 index 0000000..67fc51f --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/document_version_item.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentVersionItem(BaseModel): + """ + DocumentVersionItem + """ # noqa: E501 + document_version_item_type: Optional[StrictStr] = None + id: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["document_version_item_type", "id"] + + @field_validator('document_version_item_type') + def document_version_item_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'default_without_stationery', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended']): + raise ValueError("must be one of enum values ('default', 'default_without_stationery', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentVersionItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "document_version_item_type", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentVersionItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "document_version_item_type": obj.get("document_version_item_type"), + "id": obj.get("id") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/document_versions.py b/generated/sync/easybill_generated_sync/models/document_versions.py new file mode 100644 index 0000000..db202a3 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/document_versions.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.document_version import DocumentVersion +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DocumentVersions(BaseModel): + """ + DocumentVersions + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[DocumentVersion]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentVersions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentVersions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [DocumentVersion.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/documents.py b/generated/sync/easybill_generated_sync/models/documents.py new file mode 100644 index 0000000..9a73908 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/documents.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.document import Document +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Documents(BaseModel): + """ + Documents + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Document]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Documents from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Documents from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Document.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/file_format_config.py b/generated/sync/easybill_generated_sync/models/file_format_config.py new file mode 100644 index 0000000..9d9a86b --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/file_format_config.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class FileFormatConfig(BaseModel): + """ + FileFormatConfig + """ # noqa: E501 + type: StrictStr + __properties: ClassVar[List[str]] = ["type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['default', 'default_without_stationery', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml']): + raise ValueError("must be one of enum values ('default', 'default_without_stationery', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung2_2_xml', 'xrechnung2_3_xml', 'xrechnung3_0_xml')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FileFormatConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FileFormatConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/list.py b/generated/sync/easybill_generated_sync/models/list.py new file mode 100644 index 0000000..8a29455 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/list.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class List(BaseModel): + """ + List + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of List from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of List from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/login.py b/generated/sync/easybill_generated_sync/models/login.py new file mode 100644 index 0000000..27932b7 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/login.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.login_security import LoginSecurity +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Login(BaseModel): + """ + Login + """ # noqa: E501 + id: Optional[StrictInt] = None + first_name: Optional[StrictStr] = None + last_name: Optional[StrictStr] = None + display_name: Optional[StrictStr] = None + phone: Optional[StrictStr] = None + email: Optional[StrictStr] = None + email_signature: Optional[StrictStr] = None + login_type: Optional[StrictStr] = 'ASSISTANT' + locale: Optional[StrictStr] = None + time_zone: Optional[StrictStr] = None + security: Optional[LoginSecurity] = None + __properties: ClassVar[List[str]] = ["id", "first_name", "last_name", "display_name", "phone", "email", "email_signature", "login_type", "locale", "time_zone", "security"] + + @field_validator('login_type') + def login_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ADMIN', 'ASSISTANT']): + raise ValueError("must be one of enum values ('ADMIN', 'ASSISTANT')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Login from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "display_name", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of security + if self.security: + _dict['security'] = self.security.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Login from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "first_name": obj.get("first_name"), + "last_name": obj.get("last_name"), + "display_name": obj.get("display_name"), + "phone": obj.get("phone"), + "email": obj.get("email"), + "email_signature": obj.get("email_signature"), + "login_type": obj.get("login_type") if obj.get("login_type") is not None else 'ASSISTANT', + "locale": obj.get("locale"), + "time_zone": obj.get("time_zone"), + "security": LoginSecurity.from_dict(obj["security"]) if obj.get("security") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/login_security.py b/generated/sync/easybill_generated_sync/models/login_security.py new file mode 100644 index 0000000..ffd034d --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/login_security.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LoginSecurity(BaseModel): + """ + This object is only displayed if your request the login resource as an admin. Otherwise this property will be null. + """ # noqa: E501 + two_factor_enabled: Optional[StrictBool] = Field(default=False, description="Shows if the login has two factor enabled for the login process") + recovery_codes_enabled: Optional[StrictBool] = Field(default=False, description="Shows if the login has recovery codes enabled to bypass two factor") + notify_on_new_login_enabled: Optional[StrictBool] = Field(default=True, description="Shows if the login has enabled to be notified if a new login is made from an unknown device.") + __properties: ClassVar[List[str]] = ["two_factor_enabled", "recovery_codes_enabled", "notify_on_new_login_enabled"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LoginSecurity from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "two_factor_enabled", + "recovery_codes_enabled", + "notify_on_new_login_enabled", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LoginSecurity from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "two_factor_enabled": obj.get("two_factor_enabled") if obj.get("two_factor_enabled") is not None else False, + "recovery_codes_enabled": obj.get("recovery_codes_enabled") if obj.get("recovery_codes_enabled") is not None else False, + "notify_on_new_login_enabled": obj.get("notify_on_new_login_enabled") if obj.get("notify_on_new_login_enabled") is not None else True + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/logins.py b/generated/sync/easybill_generated_sync/models/logins.py new file mode 100644 index 0000000..a4b95ff --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/logins.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.login import Login +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Logins(BaseModel): + """ + Logins + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Login]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Logins from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Logins from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Login.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/pdf_template.py b/generated/sync/easybill_generated_sync/models/pdf_template.py new file mode 100644 index 0000000..4303805 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/pdf_template.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.pdf_template_settings import PDFTemplateSettings +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PDFTemplate(BaseModel): + """ + PDFTemplate + """ # noqa: E501 + id: Optional[StrictStr] = 'INVOICE-DE' + name: Optional[StrictStr] = 'Default template' + pdf_template: Optional[StrictStr] = 'DE' + document_type: Optional[StrictStr] = 'INVOICE' + settings: Optional[PDFTemplateSettings] = None + __properties: ClassVar[List[str]] = ["id", "name", "pdf_template", "document_type", "settings"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PDFTemplate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of settings + if self.settings: + _dict['settings'] = self.settings.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PDFTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id") if obj.get("id") is not None else 'INVOICE-DE', + "name": obj.get("name") if obj.get("name") is not None else 'Default template', + "pdf_template": obj.get("pdf_template") if obj.get("pdf_template") is not None else 'DE', + "document_type": obj.get("document_type") if obj.get("document_type") is not None else 'INVOICE', + "settings": PDFTemplateSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/pdf_template_settings.py b/generated/sync/easybill_generated_sync/models/pdf_template_settings.py new file mode 100644 index 0000000..b2fa205 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/pdf_template_settings.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.pdf_template_settings_email import PDFTemplateSettingsEmail +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PDFTemplateSettings(BaseModel): + """ + PDFTemplateSettings + """ # noqa: E501 + text_prefix: Optional[StrictStr] = '' + text: Optional[StrictStr] = '' + email: Optional[PDFTemplateSettingsEmail] = None + __properties: ClassVar[List[str]] = ["text_prefix", "text", "email"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PDFTemplateSettings from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of email + if self.email: + _dict['email'] = self.email.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PDFTemplateSettings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "text_prefix": obj.get("text_prefix") if obj.get("text_prefix") is not None else '', + "text": obj.get("text") if obj.get("text") is not None else '', + "email": PDFTemplateSettingsEmail.from_dict(obj["email"]) if obj.get("email") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/pdf_template_settings_email.py b/generated/sync/easybill_generated_sync/models/pdf_template_settings_email.py new file mode 100644 index 0000000..f661ec9 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/pdf_template_settings_email.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PDFTemplateSettingsEmail(BaseModel): + """ + PDFTemplateSettingsEmail + """ # noqa: E501 + subject: Optional[StrictStr] = '' + message: Optional[StrictStr] = '' + __properties: ClassVar[List[str]] = ["subject", "message"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PDFTemplateSettingsEmail from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PDFTemplateSettingsEmail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "subject": obj.get("subject") if obj.get("subject") is not None else '', + "message": obj.get("message") if obj.get("message") is not None else '' + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/pdf_templates.py b/generated/sync/easybill_generated_sync/models/pdf_templates.py new file mode 100644 index 0000000..5889a6b --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/pdf_templates.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.pdf_template import PDFTemplate +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PDFTemplates(BaseModel): + """ + PDFTemplates + """ # noqa: E501 + items: Optional[List[PDFTemplate]] = None + __properties: ClassVar[List[str]] = ["items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PDFTemplates from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PDFTemplates from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [PDFTemplate.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/position.py b/generated/sync/easybill_generated_sync/models/position.py new file mode 100644 index 0000000..b234826 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/position.py @@ -0,0 +1,287 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from easybill_generated_sync.models.position_export_identifier_extended import PositionExportIdentifierExtended +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Position(BaseModel): + """ + Position + """ # noqa: E501 + id: Optional[StrictInt] = None + type: Optional[StrictStr] = 'PRODUCT' + number: StrictStr + description: StrictStr = Field(description="The positions name or description") + document_note: Optional[StrictStr] = Field(default=None, description="This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction.") + note: Optional[StrictStr] = Field(default='null', description="Note for internal use") + unit: Optional[StrictStr] = 'null' + export_identifier: Optional[StrictStr] = Field(default='null', description="The FAS-Account is the four-digit revenue account, in which the revenue will be entered when doing the export to your tax consultant. In case you want to split your revenue to several revenue accounts, please talk to your tax consultant before, to guarantee an unobstructed use of the interface. For every revenue element, there are number ranges, which can be used. Please avoid using combinations of numbers, which can not be used by your tax consultant.") + export_identifier_extended: Optional[PositionExportIdentifierExtended] = None + login_id: Optional[StrictInt] = None + price_type: Optional[StrictStr] = 'NETTO' + vat_percent: Optional[Union[StrictFloat, StrictInt]] = 19.0 + sale_price: Union[StrictFloat, StrictInt] = Field(description="Price in cents (e.g. \"150\" = 1.50€)") + sale_price2: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 2 in cents (e.g. \"150\" = 1.50€)") + sale_price3: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 3 in cents (e.g. \"150\" = 1.50€)") + sale_price4: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 4 in cents (e.g. \"150\" = 1.50€)") + sale_price5: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 5 in cents (e.g. \"150\" = 1.50€)") + sale_price6: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 6 in cents (e.g. \"150\" = 1.50€)") + sale_price7: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 7 in cents (e.g. \"150\" = 1.50€)") + sale_price8: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 8 in cents (e.g. \"150\" = 1.50€)") + sale_price9: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 9 in cents (e.g. \"150\" = 1.50€)") + sale_price10: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 10 in cents (e.g. \"150\" = 1.50€)") + cost_price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents (e.g. \"150\" = 1.50€)") + export_cost1: Optional[StrictStr] = 'null' + export_cost2: Optional[StrictStr] = 'null' + group_id: Optional[StrictInt] = None + stock: Optional[StrictStr] = Field(default='NO', description="Activates stock management for this position") + stock_count: Optional[StrictInt] = Field(default=None, description="Current stock count") + stock_limit_notify: Optional[StrictBool] = Field(default=False, description="Notify when stock_count is lower than stock_limit") + stock_limit_notify_frequency: Optional[StrictStr] = Field(default='ALWAYS', description="Notify frequency when stock_count is lower than stock_limit (ALWAYS, ONCE)") + stock_limit: Optional[StrictInt] = None + quantity: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Used as the default quantity when adding this position to a document") + archived: Optional[StrictBool] = False + __properties: ClassVar[List[str]] = ["id", "type", "number", "description", "document_note", "note", "unit", "export_identifier", "export_identifier_extended", "login_id", "price_type", "vat_percent", "sale_price", "sale_price2", "sale_price3", "sale_price4", "sale_price5", "sale_price6", "sale_price7", "sale_price8", "sale_price9", "sale_price10", "cost_price", "export_cost1", "export_cost2", "group_id", "stock", "stock_count", "stock_limit_notify", "stock_limit_notify_frequency", "stock_limit", "quantity", "archived"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['PRODUCT', 'SERVICE', 'TEXT']): + raise ValueError("must be one of enum values ('PRODUCT', 'SERVICE', 'TEXT')") + return value + + @field_validator('price_type') + def price_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['BRUTTO', 'NETTO']): + raise ValueError("must be one of enum values ('BRUTTO', 'NETTO')") + return value + + @field_validator('stock') + def stock_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['YES', 'NO']): + raise ValueError("must be one of enum values ('YES', 'NO')") + return value + + @field_validator('stock_limit_notify_frequency') + def stock_limit_notify_frequency_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ALWAYS', 'ONCE']): + raise ValueError("must be one of enum values ('ALWAYS', 'ONCE')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Position from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "login_id", + "stock_count", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of export_identifier_extended + if self.export_identifier_extended: + _dict['export_identifier_extended'] = self.export_identifier_extended.to_dict() + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if unit (nullable) is None + # and model_fields_set contains the field + if self.unit is None and "unit" in self.model_fields_set: + _dict['unit'] = None + + # set to None if export_identifier (nullable) is None + # and model_fields_set contains the field + if self.export_identifier is None and "export_identifier" in self.model_fields_set: + _dict['export_identifier'] = None + + # set to None if sale_price2 (nullable) is None + # and model_fields_set contains the field + if self.sale_price2 is None and "sale_price2" in self.model_fields_set: + _dict['sale_price2'] = None + + # set to None if sale_price3 (nullable) is None + # and model_fields_set contains the field + if self.sale_price3 is None and "sale_price3" in self.model_fields_set: + _dict['sale_price3'] = None + + # set to None if sale_price4 (nullable) is None + # and model_fields_set contains the field + if self.sale_price4 is None and "sale_price4" in self.model_fields_set: + _dict['sale_price4'] = None + + # set to None if sale_price5 (nullable) is None + # and model_fields_set contains the field + if self.sale_price5 is None and "sale_price5" in self.model_fields_set: + _dict['sale_price5'] = None + + # set to None if sale_price6 (nullable) is None + # and model_fields_set contains the field + if self.sale_price6 is None and "sale_price6" in self.model_fields_set: + _dict['sale_price6'] = None + + # set to None if sale_price7 (nullable) is None + # and model_fields_set contains the field + if self.sale_price7 is None and "sale_price7" in self.model_fields_set: + _dict['sale_price7'] = None + + # set to None if sale_price8 (nullable) is None + # and model_fields_set contains the field + if self.sale_price8 is None and "sale_price8" in self.model_fields_set: + _dict['sale_price8'] = None + + # set to None if sale_price9 (nullable) is None + # and model_fields_set contains the field + if self.sale_price9 is None and "sale_price9" in self.model_fields_set: + _dict['sale_price9'] = None + + # set to None if sale_price10 (nullable) is None + # and model_fields_set contains the field + if self.sale_price10 is None and "sale_price10" in self.model_fields_set: + _dict['sale_price10'] = None + + # set to None if cost_price (nullable) is None + # and model_fields_set contains the field + if self.cost_price is None and "cost_price" in self.model_fields_set: + _dict['cost_price'] = None + + # set to None if export_cost1 (nullable) is None + # and model_fields_set contains the field + if self.export_cost1 is None and "export_cost1" in self.model_fields_set: + _dict['export_cost1'] = None + + # set to None if export_cost2 (nullable) is None + # and model_fields_set contains the field + if self.export_cost2 is None and "export_cost2" in self.model_fields_set: + _dict['export_cost2'] = None + + # set to None if group_id (nullable) is None + # and model_fields_set contains the field + if self.group_id is None and "group_id" in self.model_fields_set: + _dict['group_id'] = None + + # set to None if quantity (nullable) is None + # and model_fields_set contains the field + if self.quantity is None and "quantity" in self.model_fields_set: + _dict['quantity'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Position from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type") if obj.get("type") is not None else 'PRODUCT', + "number": obj.get("number"), + "description": obj.get("description"), + "document_note": obj.get("document_note"), + "note": obj.get("note") if obj.get("note") is not None else 'null', + "unit": obj.get("unit") if obj.get("unit") is not None else 'null', + "export_identifier": obj.get("export_identifier") if obj.get("export_identifier") is not None else 'null', + "export_identifier_extended": PositionExportIdentifierExtended.from_dict(obj["export_identifier_extended"]) if obj.get("export_identifier_extended") is not None else None, + "login_id": obj.get("login_id"), + "price_type": obj.get("price_type") if obj.get("price_type") is not None else 'NETTO', + "vat_percent": obj.get("vat_percent") if obj.get("vat_percent") is not None else 19.0, + "sale_price": obj.get("sale_price"), + "sale_price2": obj.get("sale_price2"), + "sale_price3": obj.get("sale_price3"), + "sale_price4": obj.get("sale_price4"), + "sale_price5": obj.get("sale_price5"), + "sale_price6": obj.get("sale_price6"), + "sale_price7": obj.get("sale_price7"), + "sale_price8": obj.get("sale_price8"), + "sale_price9": obj.get("sale_price9"), + "sale_price10": obj.get("sale_price10"), + "cost_price": obj.get("cost_price"), + "export_cost1": obj.get("export_cost1") if obj.get("export_cost1") is not None else 'null', + "export_cost2": obj.get("export_cost2") if obj.get("export_cost2") is not None else 'null', + "group_id": obj.get("group_id"), + "stock": obj.get("stock") if obj.get("stock") is not None else 'NO', + "stock_count": obj.get("stock_count"), + "stock_limit_notify": obj.get("stock_limit_notify") if obj.get("stock_limit_notify") is not None else False, + "stock_limit_notify_frequency": obj.get("stock_limit_notify_frequency") if obj.get("stock_limit_notify_frequency") is not None else 'ALWAYS', + "stock_limit": obj.get("stock_limit"), + "quantity": obj.get("quantity"), + "archived": obj.get("archived") if obj.get("archived") is not None else False + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/position_export_identifier_extended.py b/generated/sync/easybill_generated_sync/models/position_export_identifier_extended.py new file mode 100644 index 0000000..daa0d39 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/position_export_identifier_extended.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PositionExportIdentifierExtended(BaseModel): + """ + PositionExportIdentifierExtended + """ # noqa: E501 + null: Optional[StrictStr] = Field(default='null', description="Umsatzsteuerpflichtig", alias="NULL") + n_stb: Optional[StrictStr] = Field(default='null', description="Nicht steuerbar (Drittland)", alias="nStb") + n_stb_ust_id: Optional[StrictStr] = Field(default='null', description="Nicht steuerbar (EU mit USt-IdNr.)", alias="nStbUstID") + n_stb_none_ust_id: Optional[StrictStr] = Field(default='null', description="Nicht steuerbar (EU ohne USt-IdNr.)", alias="nStbNoneUstID") + n_stb_im: Optional[StrictStr] = Field(default='null', description="Nicht steuerbarer Innenumsatz", alias="nStbIm") + revc: Optional[StrictStr] = Field(default='null', description="Steuerschuldwechsel §13b (Inland)") + ig: Optional[StrictStr] = Field(default='null', description="Innergemeinschaftliche Lieferung", alias="IG") + al: Optional[StrictStr] = Field(default='null', description="Ausfuhrlieferung", alias="AL") + s_stfr: Optional[StrictStr] = Field(default='null', description="sonstige Steuerbefreiung", alias="sStfr") + small_business: Optional[StrictStr] = Field(default='null', description="Kleinunternehmen (Keine MwSt.)", alias="smallBusiness") + __properties: ClassVar[List[str]] = ["NULL", "nStb", "nStbUstID", "nStbNoneUstID", "nStbIm", "revc", "IG", "AL", "sStfr", "smallBusiness"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PositionExportIdentifierExtended from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if null (nullable) is None + # and model_fields_set contains the field + if self.null is None and "null" in self.model_fields_set: + _dict['NULL'] = None + + # set to None if n_stb (nullable) is None + # and model_fields_set contains the field + if self.n_stb is None and "n_stb" in self.model_fields_set: + _dict['nStb'] = None + + # set to None if n_stb_ust_id (nullable) is None + # and model_fields_set contains the field + if self.n_stb_ust_id is None and "n_stb_ust_id" in self.model_fields_set: + _dict['nStbUstID'] = None + + # set to None if n_stb_none_ust_id (nullable) is None + # and model_fields_set contains the field + if self.n_stb_none_ust_id is None and "n_stb_none_ust_id" in self.model_fields_set: + _dict['nStbNoneUstID'] = None + + # set to None if n_stb_im (nullable) is None + # and model_fields_set contains the field + if self.n_stb_im is None and "n_stb_im" in self.model_fields_set: + _dict['nStbIm'] = None + + # set to None if revc (nullable) is None + # and model_fields_set contains the field + if self.revc is None and "revc" in self.model_fields_set: + _dict['revc'] = None + + # set to None if ig (nullable) is None + # and model_fields_set contains the field + if self.ig is None and "ig" in self.model_fields_set: + _dict['IG'] = None + + # set to None if al (nullable) is None + # and model_fields_set contains the field + if self.al is None and "al" in self.model_fields_set: + _dict['AL'] = None + + # set to None if s_stfr (nullable) is None + # and model_fields_set contains the field + if self.s_stfr is None and "s_stfr" in self.model_fields_set: + _dict['sStfr'] = None + + # set to None if small_business (nullable) is None + # and model_fields_set contains the field + if self.small_business is None and "small_business" in self.model_fields_set: + _dict['smallBusiness'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PositionExportIdentifierExtended from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "NULL": obj.get("NULL") if obj.get("NULL") is not None else 'null', + "nStb": obj.get("nStb") if obj.get("nStb") is not None else 'null', + "nStbUstID": obj.get("nStbUstID") if obj.get("nStbUstID") is not None else 'null', + "nStbNoneUstID": obj.get("nStbNoneUstID") if obj.get("nStbNoneUstID") is not None else 'null', + "nStbIm": obj.get("nStbIm") if obj.get("nStbIm") is not None else 'null', + "revc": obj.get("revc") if obj.get("revc") is not None else 'null', + "IG": obj.get("IG") if obj.get("IG") is not None else 'null', + "AL": obj.get("AL") if obj.get("AL") is not None else 'null', + "sStfr": obj.get("sStfr") if obj.get("sStfr") is not None else 'null', + "smallBusiness": obj.get("smallBusiness") if obj.get("smallBusiness") is not None else 'null' + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/position_group.py b/generated/sync/easybill_generated_sync/models/position_group.py new file mode 100644 index 0000000..469ea46 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/position_group.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PositionGroup(BaseModel): + """ + PositionGroup + """ # noqa: E501 + description: Optional[StrictStr] = 'null' + login_id: Optional[StrictInt] = None + name: StrictStr + number: StrictStr + display_name: Optional[StrictStr] = None + id: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["description", "login_id", "name", "number", "display_name", "id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PositionGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "login_id", + "display_name", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PositionGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description") if obj.get("description") is not None else 'null', + "login_id": obj.get("login_id"), + "name": obj.get("name"), + "number": obj.get("number"), + "display_name": obj.get("display_name"), + "id": obj.get("id") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/position_groups.py b/generated/sync/easybill_generated_sync/models/position_groups.py new file mode 100644 index 0000000..471f503 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/position_groups.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.position_group import PositionGroup +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PositionGroups(BaseModel): + """ + PositionGroups + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[PositionGroup]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PositionGroups from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PositionGroups from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [PositionGroup.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/positions.py b/generated/sync/easybill_generated_sync/models/positions.py new file mode 100644 index 0000000..efc36d9 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/positions.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.position import Position +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Positions(BaseModel): + """ + Positions + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Position]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Positions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Positions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Position.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/post_box.py b/generated/sync/easybill_generated_sync/models/post_box.py new file mode 100644 index 0000000..ca857d2 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/post_box.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PostBox(BaseModel): + """ + PostBox + """ # noqa: E501 + id: Optional[StrictInt] = None + document_id: Optional[StrictInt] = None + to: Optional[StrictStr] = None + cc: Optional[StrictStr] = None + var_from: Optional[StrictStr] = Field(default=None, alias="from") + subject: Optional[StrictStr] = None + message: Optional[StrictStr] = None + var_date: Optional[date] = Field(default=None, alias="date") + created_at: Optional[datetime] = None + processed_at: Optional[datetime] = None + send_by_self: Optional[StrictBool] = None + send_with_attachment: Optional[StrictBool] = None + type: Optional[StrictStr] = None + status: Optional[StrictStr] = None + status_msg: Optional[StrictStr] = None + login_id: Optional[StrictInt] = None + document_file_type: Optional[StrictStr] = None + post_send_type: Optional[StrictStr] = Field(default=None, description="This value indicates what method is used when the document is send via mail. The different types are offered by the german post as additional services. The registered mail options will include a tracking number which will be added to the postbox when known. If the value is omitted or empty when a postbox is created with the type \"POST\" post_send_type_standard will be used. For postbox with a different type than \"POST\" this field will hold a empty string. ") + tracking_identifier: Optional[StrictStr] = Field(default=None, description="If the document is send with one of the registered send types stated for post_send_type, a tracking identifier will be added to the postbox at a later point when the tracking identifier is provided by our service partner. ") + __properties: ClassVar[List[str]] = ["id", "document_id", "to", "cc", "from", "subject", "message", "date", "created_at", "processed_at", "send_by_self", "send_with_attachment", "type", "status", "status_msg", "login_id", "document_file_type", "post_send_type", "tracking_identifier"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['FAX', 'EMAIL', 'POST']): + raise ValueError("must be one of enum values ('FAX', 'EMAIL', 'POST')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['WAITING', 'PREPARE', 'ERROR', 'OK', 'PROCESSING']): + raise ValueError("must be one of enum values ('WAITING', 'PREPARE', 'ERROR', 'OK', 'PROCESSING')") + return value + + @field_validator('document_file_type') + def document_file_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung', 'xrechnung_xml']): + raise ValueError("must be one of enum values ('default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung', 'xrechnung_xml')") + return value + + @field_validator('post_send_type') + def post_send_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['post_send_type_standard', 'post_send_type_registered', 'post_send_type_registered_and_personal', 'post_send_type_registered_and_receipt', 'post_send_type_registered_throwin', 'post_send_type_prio']): + raise ValueError("must be one of enum values ('post_send_type_standard', 'post_send_type_registered', 'post_send_type_registered_and_personal', 'post_send_type_registered_and_receipt', 'post_send_type_registered_throwin', 'post_send_type_prio')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PostBox from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "login_id", + "tracking_identifier", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if document_file_type (nullable) is None + # and model_fields_set contains the field + if self.document_file_type is None and "document_file_type" in self.model_fields_set: + _dict['document_file_type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PostBox from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "document_id": obj.get("document_id"), + "to": obj.get("to"), + "cc": obj.get("cc"), + "from": obj.get("from"), + "subject": obj.get("subject"), + "message": obj.get("message"), + "date": obj.get("date"), + "created_at": obj.get("created_at"), + "processed_at": obj.get("processed_at"), + "send_by_self": obj.get("send_by_self"), + "send_with_attachment": obj.get("send_with_attachment"), + "type": obj.get("type"), + "status": obj.get("status"), + "status_msg": obj.get("status_msg"), + "login_id": obj.get("login_id"), + "document_file_type": obj.get("document_file_type"), + "post_send_type": obj.get("post_send_type"), + "tracking_identifier": obj.get("tracking_identifier") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/post_box_request.py b/generated/sync/easybill_generated_sync/models/post_box_request.py new file mode 100644 index 0000000..3db4318 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/post_box_request.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PostBoxRequest(BaseModel): + """ + PostBoxRequest + """ # noqa: E501 + to: Optional[StrictStr] = None + cc: Optional[StrictStr] = None + var_from: Optional[StrictStr] = Field(default=None, alias="from") + subject: Optional[StrictStr] = None + message: Optional[StrictStr] = None + var_date: Optional[date] = Field(default=None, alias="date") + send_by_self: Optional[StrictBool] = None + send_with_attachment: Optional[StrictBool] = True + document_file_type: Optional[StrictStr] = Field(default=None, description="When set to null, the setting on the customer is used") + post_send_type: Optional[StrictStr] = Field(default=None, description="This value indicates what method is used when the document is send via mail. The different types are offered by the german post as additional services. The registered mail options will include a tracking number which will be added to the postbox when known. If the value is omitted or empty when a postbox is created with the type \"POST\" post_send_type_standard will be used. For postbox with a different type than \"POST\" this field will hold a empty string. ") + __properties: ClassVar[List[str]] = ["to", "cc", "from", "subject", "message", "date", "send_by_self", "send_with_attachment", "document_file_type", "post_send_type"] + + @field_validator('document_file_type') + def document_file_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung', 'xrechnung_xml', 'xrechnung2_2_xml', 'xrechnung3_0_xml']): + raise ValueError("must be one of enum values ('default', 'zugferd1', 'zugferd2_2', 'zugferd2_4_en16931', 'zugferd2_4_extended', 'xrechnung', 'xrechnung_xml', 'xrechnung2_2_xml', 'xrechnung3_0_xml')") + return value + + @field_validator('post_send_type') + def post_send_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['post_send_type_standard', 'post_send_type_registered', 'post_send_type_registered_and_personal', 'post_send_type_registered_and_receipt', 'post_send_type_registered_throwin']): + raise ValueError("must be one of enum values ('post_send_type_standard', 'post_send_type_registered', 'post_send_type_registered_and_personal', 'post_send_type_registered_and_receipt', 'post_send_type_registered_throwin')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PostBoxRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if document_file_type (nullable) is None + # and model_fields_set contains the field + if self.document_file_type is None and "document_file_type" in self.model_fields_set: + _dict['document_file_type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PostBoxRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "to": obj.get("to"), + "cc": obj.get("cc"), + "from": obj.get("from"), + "subject": obj.get("subject"), + "message": obj.get("message"), + "date": obj.get("date"), + "send_by_self": obj.get("send_by_self"), + "send_with_attachment": obj.get("send_with_attachment") if obj.get("send_with_attachment") is not None else True, + "document_file_type": obj.get("document_file_type"), + "post_send_type": obj.get("post_send_type") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/post_boxes.py b/generated/sync/easybill_generated_sync/models/post_boxes.py new file mode 100644 index 0000000..2afc974 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/post_boxes.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.post_box import PostBox +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PostBoxes(BaseModel): + """ + PostBoxes + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[PostBox]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PostBoxes from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PostBoxes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [PostBox.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/project.py b/generated/sync/easybill_generated_sync/models/project.py new file mode 100644 index 0000000..831025b --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/project.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Project(BaseModel): + """ + Project + """ # noqa: E501 + budget_amount: Optional[StrictInt] = Field(default=None, description="Project budget in cents (e.g. \"150\" = 1.50€)") + budget_time: Optional[StrictInt] = Field(default=None, description="Time budget in minutes (e.g. \"90\" = 1 hour and 30 minutes)") + customer_id: Optional[StrictInt] = None + hourly_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Hourly rate in cents (e.g. \"150\" = 1.50€)") + id: Optional[StrictInt] = None + login_id: Optional[StrictInt] = Field(default=None, description="If omitted or null, the currently active login is used") + name: StrictStr + note: Optional[StrictStr] = 'null' + status: Optional[StrictStr] = 'OPEN' + due_at: Optional[date] = None + budget_notify_frequency: Optional[StrictStr] = 'ALWAYS' + consumed_time: Optional[StrictInt] = None + consumed_amount: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["budget_amount", "budget_time", "customer_id", "hourly_rate", "id", "login_id", "name", "note", "status", "due_at", "budget_notify_frequency", "consumed_time", "consumed_amount"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['OPEN', 'DONE', 'CANCEL']): + raise ValueError("must be one of enum values ('OPEN', 'DONE', 'CANCEL')") + return value + + @field_validator('budget_notify_frequency') + def budget_notify_frequency_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ALWAYS', 'ONCE', 'NEVER']): + raise ValueError("must be one of enum values ('ALWAYS', 'ONCE', 'NEVER')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Project from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "consumed_time", + "consumed_amount", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if customer_id (nullable) is None + # and model_fields_set contains the field + if self.customer_id is None and "customer_id" in self.model_fields_set: + _dict['customer_id'] = None + + # set to None if login_id (nullable) is None + # and model_fields_set contains the field + if self.login_id is None and "login_id" in self.model_fields_set: + _dict['login_id'] = None + + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if due_at (nullable) is None + # and model_fields_set contains the field + if self.due_at is None and "due_at" in self.model_fields_set: + _dict['due_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Project from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "budget_amount": obj.get("budget_amount"), + "budget_time": obj.get("budget_time"), + "customer_id": obj.get("customer_id"), + "hourly_rate": obj.get("hourly_rate"), + "id": obj.get("id"), + "login_id": obj.get("login_id"), + "name": obj.get("name"), + "note": obj.get("note") if obj.get("note") is not None else 'null', + "status": obj.get("status") if obj.get("status") is not None else 'OPEN', + "due_at": obj.get("due_at"), + "budget_notify_frequency": obj.get("budget_notify_frequency") if obj.get("budget_notify_frequency") is not None else 'ALWAYS', + "consumed_time": obj.get("consumed_time"), + "consumed_amount": obj.get("consumed_amount") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/projects.py b/generated/sync/easybill_generated_sync/models/projects.py new file mode 100644 index 0000000..e82cb0e --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/projects.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.project import Project +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Projects(BaseModel): + """ + Projects + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Project]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Projects from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Projects from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Project.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/sepa_payment.py b/generated/sync/easybill_generated_sync/models/sepa_payment.py new file mode 100644 index 0000000..794cd9b --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/sepa_payment.py @@ -0,0 +1,208 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SEPAPayment(BaseModel): + """ + SEPAPayment + """ # noqa: E501 + amount: StrictInt = Field(description="Amount in cents (e.g. \"150\" = 1.50€)") + created_at: Optional[datetime] = None + creditor_bic: Optional[StrictStr] = Field(default='null', description="If type is DEBIT, this field is overwritten with the selected bank account data on export.") + creditor_iban: Optional[StrictStr] = Field(default=None, description="Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export.") + creditor_name: Optional[StrictStr] = Field(default=None, description="Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export.") + debitor_bic: Optional[StrictStr] = Field(default='null', description="If type is CREDIT, this field is overwritten with the selected bank account data on export.") + debitor_iban: Optional[StrictStr] = Field(description="Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export.") + debitor_name: Optional[StrictStr] = Field(description="Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export.") + debitor_address_line_1: Optional[Annotated[str, Field(strict=True, max_length=70)]] = Field(default=None, description="Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA") + debitor_address_line2: Optional[Annotated[str, Field(strict=True, max_length=70)]] = Field(default=None, description="string") + debitor_country: Optional[Annotated[str, Field(strict=True, max_length=2)]] = Field(default=None, description="Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA") + document_id: StrictInt + export_at: Optional[datetime] = Field(default=None, description="If a date is set, this record is marked as exported") + export_error: Optional[StrictStr] = None + id: Optional[StrictInt] = None + local_instrument: StrictStr = Field(description="CORE: SEPA Core Direct Debit
COR1: SEPA-Basislastschrift COR1 (deprecated use CORE instead)
B2B: SEPA Business to Business Direct Debit") + mandate_date_of_signature: date + mandate_id: Annotated[str, Field(strict=True, max_length=34)] + reference: Annotated[str, Field(strict=True, max_length=35)] + remittance_information: Optional[Annotated[str, Field(strict=True, max_length=140)]] = 'null' + requested_at: Optional[date] = Field(default=None, description="Booking date") + sequence_type: StrictStr = Field(description="FRST: Erstlastschrift
RCUR: Folgelastschrift
OOFF: Einmallastschrift
FNAL: Letztmalige Lastschrift") + updated_at: Optional[StrictStr] = None + type: Optional[StrictStr] = 'DEBIT' + __properties: ClassVar[List[str]] = ["amount", "created_at", "creditor_bic", "creditor_iban", "creditor_name", "debitor_bic", "debitor_iban", "debitor_name", "debitor_address_line_1", "debitor_address_line2", "debitor_country", "document_id", "export_at", "export_error", "id", "local_instrument", "mandate_date_of_signature", "mandate_id", "reference", "remittance_information", "requested_at", "sequence_type", "updated_at", "type"] + + @field_validator('local_instrument') + def local_instrument_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CORE', 'COR1', 'B2B']): + raise ValueError("must be one of enum values ('CORE', 'COR1', 'B2B')") + return value + + @field_validator('sequence_type') + def sequence_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['FRST', 'OOFF', 'FNAL', 'RCUR']): + raise ValueError("must be one of enum values ('FRST', 'OOFF', 'FNAL', 'RCUR')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['DEBIT', 'CREDIT']): + raise ValueError("must be one of enum values ('DEBIT', 'CREDIT')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SEPAPayment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "export_error", + "id", + "updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if creditor_bic (nullable) is None + # and model_fields_set contains the field + if self.creditor_bic is None and "creditor_bic" in self.model_fields_set: + _dict['creditor_bic'] = None + + # set to None if creditor_iban (nullable) is None + # and model_fields_set contains the field + if self.creditor_iban is None and "creditor_iban" in self.model_fields_set: + _dict['creditor_iban'] = None + + # set to None if creditor_name (nullable) is None + # and model_fields_set contains the field + if self.creditor_name is None and "creditor_name" in self.model_fields_set: + _dict['creditor_name'] = None + + # set to None if debitor_bic (nullable) is None + # and model_fields_set contains the field + if self.debitor_bic is None and "debitor_bic" in self.model_fields_set: + _dict['debitor_bic'] = None + + # set to None if debitor_iban (nullable) is None + # and model_fields_set contains the field + if self.debitor_iban is None and "debitor_iban" in self.model_fields_set: + _dict['debitor_iban'] = None + + # set to None if debitor_name (nullable) is None + # and model_fields_set contains the field + if self.debitor_name is None and "debitor_name" in self.model_fields_set: + _dict['debitor_name'] = None + + # set to None if export_at (nullable) is None + # and model_fields_set contains the field + if self.export_at is None and "export_at" in self.model_fields_set: + _dict['export_at'] = None + + # set to None if remittance_information (nullable) is None + # and model_fields_set contains the field + if self.remittance_information is None and "remittance_information" in self.model_fields_set: + _dict['remittance_information'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SEPAPayment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "amount": obj.get("amount"), + "created_at": obj.get("created_at"), + "creditor_bic": obj.get("creditor_bic") if obj.get("creditor_bic") is not None else 'null', + "creditor_iban": obj.get("creditor_iban"), + "creditor_name": obj.get("creditor_name"), + "debitor_bic": obj.get("debitor_bic") if obj.get("debitor_bic") is not None else 'null', + "debitor_iban": obj.get("debitor_iban"), + "debitor_name": obj.get("debitor_name"), + "debitor_address_line_1": obj.get("debitor_address_line_1"), + "debitor_address_line2": obj.get("debitor_address_line2"), + "debitor_country": obj.get("debitor_country"), + "document_id": obj.get("document_id"), + "export_at": obj.get("export_at"), + "export_error": obj.get("export_error"), + "id": obj.get("id"), + "local_instrument": obj.get("local_instrument"), + "mandate_date_of_signature": obj.get("mandate_date_of_signature"), + "mandate_id": obj.get("mandate_id"), + "reference": obj.get("reference"), + "remittance_information": obj.get("remittance_information") if obj.get("remittance_information") is not None else 'null', + "requested_at": obj.get("requested_at"), + "sequence_type": obj.get("sequence_type"), + "updated_at": obj.get("updated_at"), + "type": obj.get("type") if obj.get("type") is not None else 'DEBIT' + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/sepa_payments.py b/generated/sync/easybill_generated_sync/models/sepa_payments.py new file mode 100644 index 0000000..e8acd0a --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/sepa_payments.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.sepa_payment import SEPAPayment +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SEPAPayments(BaseModel): + """ + SEPAPayments + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[SEPAPayment]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SEPAPayments from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SEPAPayments from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [SEPAPayment.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/serial_number.py b/generated/sync/easybill_generated_sync/models/serial_number.py new file mode 100644 index 0000000..dc9d9a8 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/serial_number.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SerialNumber(BaseModel): + """ + SerialNumber + """ # noqa: E501 + id: Optional[StrictInt] = None + serial_number: StrictStr + position_id: StrictInt + document_id: Optional[StrictInt] = None + document_position_id: Optional[StrictInt] = None + used_at: Optional[StrictStr] = None + created_at: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "serial_number", "position_id", "document_id", "document_position_id", "used_at", "created_at"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SerialNumber from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "document_id", + "document_position_id", + "used_at", + "created_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if document_id (nullable) is None + # and model_fields_set contains the field + if self.document_id is None and "document_id" in self.model_fields_set: + _dict['document_id'] = None + + # set to None if document_position_id (nullable) is None + # and model_fields_set contains the field + if self.document_position_id is None and "document_position_id" in self.model_fields_set: + _dict['document_position_id'] = None + + # set to None if used_at (nullable) is None + # and model_fields_set contains the field + if self.used_at is None and "used_at" in self.model_fields_set: + _dict['used_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SerialNumber from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "serial_number": obj.get("serial_number"), + "position_id": obj.get("position_id"), + "document_id": obj.get("document_id"), + "document_position_id": obj.get("document_position_id"), + "used_at": obj.get("used_at"), + "created_at": obj.get("created_at") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/serial_numbers.py b/generated/sync/easybill_generated_sync/models/serial_numbers.py new file mode 100644 index 0000000..782198e --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/serial_numbers.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.serial_number import SerialNumber +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SerialNumbers(BaseModel): + """ + SerialNumbers + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[SerialNumber]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SerialNumbers from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SerialNumbers from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [SerialNumber.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/service_date.py b/generated/sync/easybill_generated_sync/models/service_date.py new file mode 100644 index 0000000..21b2e9f --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/service_date.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ServiceDate(BaseModel): + """ + This object is only available in document type INVOICE or CREDIT. + """ # noqa: E501 + type: Optional[StrictStr] = Field(default=None, description="With DEFAULT no other fields are required and this message will be printed: 'Invoice date coincides with the time of supply'.
For SERVICE or DELIVERY exactly one of the following fields must be set: date, date_from and date_to or text.") + var_date: Optional[date] = Field(default=None, alias="date") + date_from: Optional[date] = None + date_to: Optional[date] = None + text: Optional[StrictStr] = 'null' + __properties: ClassVar[List[str]] = ["type", "date", "date_from", "date_to", "text"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['DEFAULT', 'SERVICE', 'DELIVERY']): + raise ValueError("must be one of enum values ('DEFAULT', 'SERVICE', 'DELIVERY')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ServiceDate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if var_date (nullable) is None + # and model_fields_set contains the field + if self.var_date is None and "var_date" in self.model_fields_set: + _dict['date'] = None + + # set to None if date_from (nullable) is None + # and model_fields_set contains the field + if self.date_from is None and "date_from" in self.model_fields_set: + _dict['date_from'] = None + + # set to None if date_to (nullable) is None + # and model_fields_set contains the field + if self.date_to is None and "date_to" in self.model_fields_set: + _dict['date_to'] = None + + # set to None if text (nullable) is None + # and model_fields_set contains the field + if self.text is None and "text" in self.model_fields_set: + _dict['text'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ServiceDate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "date": obj.get("date"), + "date_from": obj.get("date_from"), + "date_to": obj.get("date_to"), + "text": obj.get("text") if obj.get("text") is not None else 'null' + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/stock.py b/generated/sync/easybill_generated_sync/models/stock.py new file mode 100644 index 0000000..6b6c660 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/stock.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Stock(BaseModel): + """ + Stock + """ # noqa: E501 + id: Optional[StrictInt] = None + note: Optional[StrictStr] = None + stock_count: StrictInt + position_id: StrictInt + document_id: Optional[StrictInt] = None + document_position_id: Optional[StrictInt] = None + stored_at: Optional[StrictStr] = None + created_at: Optional[StrictStr] = None + updated_at: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "note", "stock_count", "position_id", "document_id", "document_position_id", "stored_at", "created_at", "updated_at"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Stock from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "document_id", + "document_position_id", + "created_at", + "updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if document_id (nullable) is None + # and model_fields_set contains the field + if self.document_id is None and "document_id" in self.model_fields_set: + _dict['document_id'] = None + + # set to None if document_position_id (nullable) is None + # and model_fields_set contains the field + if self.document_position_id is None and "document_position_id" in self.model_fields_set: + _dict['document_position_id'] = None + + # set to None if stored_at (nullable) is None + # and model_fields_set contains the field + if self.stored_at is None and "stored_at" in self.model_fields_set: + _dict['stored_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Stock from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "note": obj.get("note"), + "stock_count": obj.get("stock_count"), + "position_id": obj.get("position_id"), + "document_id": obj.get("document_id"), + "document_position_id": obj.get("document_position_id"), + "stored_at": obj.get("stored_at"), + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/stocks.py b/generated/sync/easybill_generated_sync/models/stocks.py new file mode 100644 index 0000000..fe6336c --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/stocks.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.stock import Stock +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Stocks(BaseModel): + """ + Stocks + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Stock]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Stocks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Stocks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Stock.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/task.py b/generated/sync/easybill_generated_sync/models/task.py new file mode 100644 index 0000000..84a2781 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/task.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Task(BaseModel): + """ + Task + """ # noqa: E501 + category: Optional[StrictStr] = null + category_custom: Optional[StrictStr] = Field(default='null', description="The name of your custom category. Can only have a value if \"category\" is \"CUSTOM\".") + created_at: Optional[datetime] = None + customer_id: Optional[StrictInt] = None + description: Optional[StrictStr] = 'null' + document_id: Optional[StrictInt] = None + end_at: Optional[datetime] = Field(default=None, description="The deadline") + finish_at: Optional[datetime] = Field(default=None, description="The time when the task was marked as done") + id: Optional[StrictInt] = None + login_id: Optional[StrictInt] = Field(default=None, description="When omitted or null, the currently active login is used") + name: StrictStr + position_id: Optional[StrictInt] = None + priority: Optional[StrictStr] = 'NORMAL' + project_id: Optional[StrictInt] = None + start_at: Optional[datetime] = None + status: StrictStr + status_percent: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["category", "category_custom", "created_at", "customer_id", "description", "document_id", "end_at", "finish_at", "id", "login_id", "name", "position_id", "priority", "project_id", "start_at", "status", "status_percent"] + + @field_validator('category') + def category_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['CALL', 'EMAIL', 'FAX', 'LUNCH', 'MEETING', 'TRAVEL', 'CUSTOM']): + raise ValueError("must be one of enum values ('CALL', 'EMAIL', 'FAX', 'LUNCH', 'MEETING', 'TRAVEL', 'CUSTOM')") + return value + + @field_validator('priority') + def priority_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['LOW', 'NORMAL', 'HIGH']): + raise ValueError("must be one of enum values ('LOW', 'NORMAL', 'HIGH')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['WAITING', 'PROCESSING', 'DONE', 'CANCEL']): + raise ValueError("must be one of enum values ('WAITING', 'PROCESSING', 'DONE', 'CANCEL')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Task from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "finish_at", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if category (nullable) is None + # and model_fields_set contains the field + if self.category is None and "category" in self.model_fields_set: + _dict['category'] = None + + # set to None if category_custom (nullable) is None + # and model_fields_set contains the field + if self.category_custom is None and "category_custom" in self.model_fields_set: + _dict['category_custom'] = None + + # set to None if customer_id (nullable) is None + # and model_fields_set contains the field + if self.customer_id is None and "customer_id" in self.model_fields_set: + _dict['customer_id'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if document_id (nullable) is None + # and model_fields_set contains the field + if self.document_id is None and "document_id" in self.model_fields_set: + _dict['document_id'] = None + + # set to None if end_at (nullable) is None + # and model_fields_set contains the field + if self.end_at is None and "end_at" in self.model_fields_set: + _dict['end_at'] = None + + # set to None if finish_at (nullable) is None + # and model_fields_set contains the field + if self.finish_at is None and "finish_at" in self.model_fields_set: + _dict['finish_at'] = None + + # set to None if login_id (nullable) is None + # and model_fields_set contains the field + if self.login_id is None and "login_id" in self.model_fields_set: + _dict['login_id'] = None + + # set to None if position_id (nullable) is None + # and model_fields_set contains the field + if self.position_id is None and "position_id" in self.model_fields_set: + _dict['position_id'] = None + + # set to None if project_id (nullable) is None + # and model_fields_set contains the field + if self.project_id is None and "project_id" in self.model_fields_set: + _dict['project_id'] = None + + # set to None if start_at (nullable) is None + # and model_fields_set contains the field + if self.start_at is None and "start_at" in self.model_fields_set: + _dict['start_at'] = None + + # set to None if status_percent (nullable) is None + # and model_fields_set contains the field + if self.status_percent is None and "status_percent" in self.model_fields_set: + _dict['status_percent'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Task from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category": obj.get("category") if obj.get("category") is not None else null, + "category_custom": obj.get("category_custom") if obj.get("category_custom") is not None else 'null', + "created_at": obj.get("created_at"), + "customer_id": obj.get("customer_id"), + "description": obj.get("description") if obj.get("description") is not None else 'null', + "document_id": obj.get("document_id"), + "end_at": obj.get("end_at"), + "finish_at": obj.get("finish_at"), + "id": obj.get("id"), + "login_id": obj.get("login_id"), + "name": obj.get("name"), + "position_id": obj.get("position_id"), + "priority": obj.get("priority") if obj.get("priority") is not None else 'NORMAL', + "project_id": obj.get("project_id"), + "start_at": obj.get("start_at"), + "status": obj.get("status"), + "status_percent": obj.get("status_percent") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/tasks.py b/generated/sync/easybill_generated_sync/models/tasks.py new file mode 100644 index 0000000..f44704d --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/tasks.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.task import Task +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Tasks(BaseModel): + """ + Tasks + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[Task]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Tasks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Tasks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [Task.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/text_template.py b/generated/sync/easybill_generated_sync/models/text_template.py new file mode 100644 index 0000000..d7928f7 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/text_template.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TextTemplate(BaseModel): + """ + TextTemplate + """ # noqa: E501 + can_modify: Optional[StrictBool] = Field(default=None, description="Deprecated, field is always true.") + id: Optional[StrictInt] = None + text: StrictStr + title: StrictStr + __properties: ClassVar[List[str]] = ["can_modify", "id", "text", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TextTemplate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "can_modify", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TextTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "can_modify": obj.get("can_modify"), + "id": obj.get("id"), + "text": obj.get("text"), + "title": obj.get("title") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/text_templates.py b/generated/sync/easybill_generated_sync/models/text_templates.py new file mode 100644 index 0000000..e8a0333 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/text_templates.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.text_template import TextTemplate +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TextTemplates(BaseModel): + """ + TextTemplates + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[TextTemplate]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TextTemplates from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TextTemplates from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [TextTemplate.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/time_tracking.py b/generated/sync/easybill_generated_sync/models/time_tracking.py new file mode 100644 index 0000000..c2bcd00 --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/time_tracking.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TimeTracking(BaseModel): + """ + TimeTracking + """ # noqa: E501 + cleared_at: Optional[datetime] = None + created_at: Optional[datetime] = None + date_from_at: Optional[datetime] = None + date_thru_at: Optional[datetime] = None + description: StrictStr + hourly_rate: Optional[Union[StrictFloat, StrictInt]] = Field(default=0.0, description="Hourly rate in cents (e.g. \"150\" = 1.50€)") + id: Optional[StrictInt] = None + note: Optional[StrictStr] = 'null' + number: Optional[StrictStr] = Field(default=None, description="Can be chosen freely") + position_id: Optional[StrictInt] = None + project_id: Optional[StrictInt] = None + login_id: Optional[StrictInt] = Field(default=None, description="If omitted or null, the currently active login is used.") + timer_value: Optional[StrictInt] = Field(default=None, description="Tracked time in minutes") + __properties: ClassVar[List[str]] = ["cleared_at", "created_at", "date_from_at", "date_thru_at", "description", "hourly_rate", "id", "note", "number", "position_id", "project_id", "login_id", "timer_value"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TimeTracking from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if cleared_at (nullable) is None + # and model_fields_set contains the field + if self.cleared_at is None and "cleared_at" in self.model_fields_set: + _dict['cleared_at'] = None + + # set to None if date_from_at (nullable) is None + # and model_fields_set contains the field + if self.date_from_at is None and "date_from_at" in self.model_fields_set: + _dict['date_from_at'] = None + + # set to None if date_thru_at (nullable) is None + # and model_fields_set contains the field + if self.date_thru_at is None and "date_thru_at" in self.model_fields_set: + _dict['date_thru_at'] = None + + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if number (nullable) is None + # and model_fields_set contains the field + if self.number is None and "number" in self.model_fields_set: + _dict['number'] = None + + # set to None if position_id (nullable) is None + # and model_fields_set contains the field + if self.position_id is None and "position_id" in self.model_fields_set: + _dict['position_id'] = None + + # set to None if project_id (nullable) is None + # and model_fields_set contains the field + if self.project_id is None and "project_id" in self.model_fields_set: + _dict['project_id'] = None + + # set to None if login_id (nullable) is None + # and model_fields_set contains the field + if self.login_id is None and "login_id" in self.model_fields_set: + _dict['login_id'] = None + + # set to None if timer_value (nullable) is None + # and model_fields_set contains the field + if self.timer_value is None and "timer_value" in self.model_fields_set: + _dict['timer_value'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TimeTracking from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cleared_at": obj.get("cleared_at"), + "created_at": obj.get("created_at"), + "date_from_at": obj.get("date_from_at"), + "date_thru_at": obj.get("date_thru_at"), + "description": obj.get("description"), + "hourly_rate": obj.get("hourly_rate") if obj.get("hourly_rate") is not None else 0.0, + "id": obj.get("id"), + "note": obj.get("note") if obj.get("note") is not None else 'null', + "number": obj.get("number"), + "position_id": obj.get("position_id"), + "project_id": obj.get("project_id"), + "login_id": obj.get("login_id"), + "timer_value": obj.get("timer_value") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/time_trackings.py b/generated/sync/easybill_generated_sync/models/time_trackings.py new file mode 100644 index 0000000..10ac59d --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/time_trackings.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.time_tracking import TimeTracking +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TimeTrackings(BaseModel): + """ + TimeTrackings + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[TimeTracking]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TimeTrackings from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TimeTrackings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [TimeTracking.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/web_hook.py b/generated/sync/easybill_generated_sync/models/web_hook.py new file mode 100644 index 0000000..653dafc --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/web_hook.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.web_hook_last_response import WebHookLastResponse +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebHook(BaseModel): + """ + WebHook + """ # noqa: E501 + content_type: StrictStr + description: StrictStr + events: List[StrictStr] + id: Optional[StrictInt] = None + is_active: Optional[StrictBool] = False + last_response: Optional[WebHookLastResponse] = None + secret: StrictStr + url: StrictStr + __properties: ClassVar[List[str]] = ["content_type", "description", "events", "id", "is_active", "last_response", "secret", "url"] + + @field_validator('content_type') + def content_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['form', 'json']): + raise ValueError("must be one of enum values ('form', 'json')") + return value + + @field_validator('events') + def events_validate_enum(cls, value): + """Validates the enum""" + for i in value: + if i not in set(['document.create', 'document.update', 'document.completed', 'document.deleted', 'document.payment_add', 'document.payment_delete', 'customer.create', 'customer.update', 'customer.delete', 'contact.create', 'contact.update', 'contact.delete', 'position.create', 'position.update', 'position.delete', 'postbox.create', 'postbox.update', 'postbox.delete', 'postbox.sent']): + raise ValueError("each list item must be one of ('document.create', 'document.update', 'document.completed', 'document.deleted', 'document.payment_add', 'document.payment_delete', 'customer.create', 'customer.update', 'customer.delete', 'contact.create', 'contact.update', 'contact.delete', 'position.create', 'position.update', 'position.delete', 'postbox.create', 'postbox.update', 'postbox.delete', 'postbox.sent')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebHook from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of last_response + if self.last_response: + _dict['last_response'] = self.last_response.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebHook from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "content_type": obj.get("content_type"), + "description": obj.get("description"), + "events": obj.get("events"), + "id": obj.get("id"), + "is_active": obj.get("is_active") if obj.get("is_active") is not None else False, + "last_response": WebHookLastResponse.from_dict(obj["last_response"]) if obj.get("last_response") is not None else None, + "secret": obj.get("secret"), + "url": obj.get("url") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/web_hook_last_response.py b/generated/sync/easybill_generated_sync/models/web_hook_last_response.py new file mode 100644 index 0000000..432034b --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/web_hook_last_response.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebHookLastResponse(BaseModel): + """ + WebHookLastResponse + """ # noqa: E501 + var_date: Optional[datetime] = Field(default=None, alias="date") + code: Optional[StrictInt] = None + response: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["date", "code", "response"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebHookLastResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "var_date", + "code", + "response", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebHookLastResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "code": obj.get("code"), + "response": obj.get("response") + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/models/web_hooks.py b/generated/sync/easybill_generated_sync/models/web_hooks.py new file mode 100644 index 0000000..32c7f8a --- /dev/null +++ b/generated/sync/easybill_generated_sync/models/web_hooks.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from easybill_generated_sync.models.web_hook import WebHook +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WebHooks(BaseModel): + """ + WebHooks + """ # noqa: E501 + page: StrictInt = Field(description="The current page") + pages: StrictInt = Field(description="Max possible pages") + limit: StrictInt = Field(description="Items limitation. Max 1000") + total: StrictInt = Field(description="Total Items") + items: Optional[List[WebHook]] = None + __properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebHooks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebHooks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "page": obj.get("page"), + "pages": obj.get("pages"), + "limit": obj.get("limit"), + "total": obj.get("total"), + "items": [WebHook.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/generated/sync/easybill_generated_sync/py.typed b/generated/sync/easybill_generated_sync/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/generated/sync/easybill_generated_sync/rest.py b/generated/sync/easybill_generated_sync/rest.py new file mode 100644 index 0000000..347496f --- /dev/null +++ b/generated/sync/easybill_generated_sync/rest.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import json +import re +import ssl +from typing import Optional, Union + +import httpx + +from easybill_generated_sync.exceptions import ApiException, ApiValueError + +RESTResponseType = httpx.Response + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status_code + self.reason = resp.reason_phrase + self.data = None + + async def read(self): + if self.data is None: + self.data = await self.response.aread() + return self.data + + @property + def headers(self): + """Returns a CIMultiDictProxy of response headers.""" + return self.response.headers + + def getheaders(self): + """Returns a CIMultiDictProxy of the response headers; use ``headers`` instead.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header; use ``headers`` instead.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + + # maxsize is number of requests to host that are allowed in parallel + self.maxsize = configuration.connection_pool_maxsize + + self.ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert, + cadata=configuration.ca_cert_data, + ) + if configuration.cert_file: + self.ssl_context.load_cert_chain( + configuration.cert_file, keyfile=configuration.key_file + ) + + if not configuration.verify_ssl: + self.ssl_context.check_hostname = False + self.ssl_context.verify_mode = ssl.CERT_NONE + + self.proxy = configuration.proxy + self.proxy_headers = configuration.proxy_headers + + self.pool_manager: Optional[httpx.AsyncClient] = None + + async def close(self): + if self.pool_manager is not None: + await self.pool_manager.aclose() + + async def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None): + """Execute request + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + timeout = _request_timeout or 5 * 60 + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + args = { + "method": method, + "url": url, + "timeout": timeout, + "headers": headers + } + + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if re.search('json', headers['Content-Type'], re.IGNORECASE): + if body is not None: + args["json"] = body + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + args["data"] = dict(post_params) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by httpx + del headers['Content-Type'] + + files = [] + data = {} + for param in post_params: + k, v = param + if isinstance(v, tuple) and len(v) == 3: + files.append((k, v)) + else: + # Ensures that dict objects are serialized + if isinstance(v, dict): + v = json.dumps(v) + elif isinstance(v, int): + v = str(v) + data[k] = v + + if files: + args["files"] = files + if data: + args["data"] = data + + # Pass a `bytes` parameter directly in the body to support + # other content types than Json when `body` argument is provided + # in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + args["data"] = body + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + + if self.pool_manager is None: + self.pool_manager = self._create_pool_manager() + + r = await self.pool_manager.request(**args) + return RESTResponse(r) + + def _create_pool_manager(self) -> httpx.AsyncClient: + limits = httpx.Limits(max_connections=self.maxsize) + + proxy = None + if self.proxy: + proxy = httpx.Proxy( + url=self.proxy, + headers=self.proxy_headers + ) + + return httpx.AsyncClient( + limits=limits, + proxy=proxy, + verify=self.ssl_context, + trust_env=True + ) diff --git a/generated/sync/git_push.sh b/generated/sync/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/generated/sync/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/generated/sync/pyproject.toml b/generated/sync/pyproject.toml new file mode 100644 index 0000000..bfb8579 --- /dev/null +++ b/generated/sync/pyproject.toml @@ -0,0 +1,94 @@ +[project] +name = "easybill_generated_sync" +version = "1.0.0" +description = "easybill REST API" +authors = [ + {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, +] +readme = "README.md" +keywords = ["OpenAPI", "OpenAPI-Generator", "easybill REST API"] +requires-python = ">=3.9" + +dependencies = [ + "python-dateutil (>=2.8.2)", + "httpx (>=0.28.1)", + "pydantic (>=2.11)", + "typing-extensions (>=4.7.1)", +] + +[project.urls] +Repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" + +[tool.poetry] +requires-poetry = ">=2.0" + +[tool.poetry.group.dev.dependencies] +pytest = ">= 7.2.1" +pytest-cov = ">= 2.8.1" +tox = ">= 3.9.0" +flake8 = ">= 4.0.0" +types-python-dateutil = ">= 2.8.19.14" +mypy = ">= 1.5" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "easybill_generated_sync", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +extra_checks = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true + +[[tool.mypy.overrides]] +module = [ + "easybill_generated_sync.configuration", +] +warn_unused_ignores = true +strict_equality = true +extra_checks = true +check_untyped_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true +disallow_untyped_calls = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +no_implicit_reexport = true +warn_return_any = true diff --git a/generated/sync/requirements.txt b/generated/sync/requirements.txt new file mode 100644 index 0000000..e8de160 --- /dev/null +++ b/generated/sync/requirements.txt @@ -0,0 +1,4 @@ +python_dateutil >= 2.8.2 +httpx = ">= 0.28.1" +pydantic >= 2.11 +typing-extensions >= 4.7.1 diff --git a/generated/sync/setup.cfg b/generated/sync/setup.cfg new file mode 100644 index 0000000..11433ee --- /dev/null +++ b/generated/sync/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/generated/sync/setup.py b/generated/sync/setup.py new file mode 100644 index 0000000..9595693 --- /dev/null +++ b/generated/sync/setup.py @@ -0,0 +1,47 @@ +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from setuptools import setup, find_packages # noqa: H301 + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools +NAME = "easybill-generated-sync" +VERSION = "1.0.0" +PYTHON_REQUIRES = ">= 3.10" +REQUIRES = [ + "python-dateutil >= 2.8.2", + "httpx >= 0.28.1", + "pydantic >= 2.11", + "typing-extensions >= 4.7.1", +] + +setup( + name=NAME, + version=VERSION, + description="easybill REST API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "easybill REST API"], + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description_content_type='text/markdown', + long_description="""\ + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode('<email>:<api_key>') # Bearer Token Authorization: Bearer <api_key> ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + """, # noqa: E501 + package_data={"easybill_generated_sync": ["py.typed"]}, +) diff --git a/generated/sync/test-requirements.txt b/generated/sync/test-requirements.txt new file mode 100644 index 0000000..e98555c --- /dev/null +++ b/generated/sync/test-requirements.txt @@ -0,0 +1,6 @@ +pytest >= 7.2.1 +pytest-cov >= 2.8.1 +tox >= 3.9.0 +flake8 >= 4.0.0 +types-python-dateutil >= 2.8.19.14 +mypy >= 1.5 diff --git a/generated/sync/test/__init__.py b/generated/sync/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/generated/sync/test/test_advanced_data_field.py b/generated/sync/test/test_advanced_data_field.py new file mode 100644 index 0000000..80e8de1 --- /dev/null +++ b/generated/sync/test/test_advanced_data_field.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.advanced_data_field import AdvancedDataField + +class TestAdvancedDataField(unittest.TestCase): + """AdvancedDataField unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AdvancedDataField: + """Test AdvancedDataField + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AdvancedDataField` + """ + model = AdvancedDataField() + if include_optional: + return AdvancedDataField( + identifier = 'BT-10', + value = 'Customer-Ref-123' + ) + else: + return AdvancedDataField( + identifier = 'BT-10', + value = 'Customer-Ref-123', + ) + """ + + def testAdvancedDataField(self): + """Test AdvancedDataField""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_attachment.py b/generated/sync/test/test_attachment.py new file mode 100644 index 0000000..bca9868 --- /dev/null +++ b/generated/sync/test/test_attachment.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.attachment import Attachment + +class TestAttachment(unittest.TestCase): + """Attachment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Attachment: + """Test Attachment + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Attachment` + """ + model = Attachment() + if include_optional: + return Attachment( + created_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + customer_id = 56, + document_id = 56, + file_name = 'my_doc.pdf', + id = 56, + project_id = 56, + size = 10022 + ) + else: + return Attachment( + ) + """ + + def testAttachment(self): + """Test Attachment""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_attachment_api.py b/generated/sync/test/test_attachment_api.py new file mode 100644 index 0000000..7643fc1 --- /dev/null +++ b/generated/sync/test/test_attachment_api.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.attachment_api import AttachmentApi + + +class TestAttachmentApi(unittest.IsolatedAsyncioTestCase): + """AttachmentApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = AttachmentApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_attachments_get(self) -> None: + """Test case for attachments_get + + Fetch attachments list + """ + pass + + async def test_attachments_id_content_get(self) -> None: + """Test case for attachments_id_content_get + + Fetch attachment content + """ + pass + + async def test_attachments_id_delete(self) -> None: + """Test case for attachments_id_delete + + Delete attachment + """ + pass + + async def test_attachments_id_get(self) -> None: + """Test case for attachments_id_get + + Fetch attachment + """ + pass + + async def test_attachments_id_put(self) -> None: + """Test case for attachments_id_put + + Update attachment + """ + pass + + async def test_attachments_post(self) -> None: + """Test case for attachments_post + + Create attachment + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_attachments.py b/generated/sync/test/test_attachments.py new file mode 100644 index 0000000..a764bc1 --- /dev/null +++ b/generated/sync/test/test_attachments.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.attachments import Attachments + +class TestAttachments(unittest.TestCase): + """Attachments unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Attachments: + """Test Attachments + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Attachments` + """ + model = Attachments() + if include_optional: + return Attachments( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.attachment.Attachment( + created_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + customer_id = 56, + document_id = 56, + file_name = 'my_doc.pdf', + id = 56, + project_id = 56, + size = 10022, ) + ] + ) + else: + return Attachments( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testAttachments(self): + """Test Attachments""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_contact.py b/generated/sync/test/test_contact.py new file mode 100644 index 0000000..f22b905 --- /dev/null +++ b/generated/sync/test/test_contact.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.contact import Contact + +class TestContact(unittest.TestCase): + """Contact unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Contact: + """Test Contact + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Contact` + """ + model = Contact() + if include_optional: + return Contact( + city = 'Musterstadt', + state = 'NRW', + company_name = 'Musterfirma GmbH', + country = 'DE', + department = 'null', + emails = [ + 'mustermann@easybill.de' + ], + fax = 'null', + first_name = 'null', + id = 56, + last_name = 'null', + login_id = 56, + mobile = 'null', + note = 'null', + personal = True, + phone_1 = 'null', + phone_2 = 'null', + salutation = 56, + street = 'Musterstr.', + suffix_1 = 'null', + suffix_2 = 'null', + title = 'null', + zip_code = 'null', + created_at = '2018-01-01 23:23:45', + updated_at = '2018-01-01 23:23:45' + ) + else: + return Contact( + city = 'Musterstadt', + street = 'Musterstr.', + ) + """ + + def testContact(self): + """Test Contact""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_contact_api.py b/generated/sync/test/test_contact_api.py new file mode 100644 index 0000000..e25121c --- /dev/null +++ b/generated/sync/test/test_contact_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.contact_api import ContactApi + + +class TestContactApi(unittest.IsolatedAsyncioTestCase): + """ContactApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = ContactApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_customers_customer_id_contacts_get(self) -> None: + """Test case for customers_customer_id_contacts_get + + Fetch customer contact list + """ + pass + + async def test_customers_customer_id_contacts_id_delete(self) -> None: + """Test case for customers_customer_id_contacts_id_delete + + Delete contact + """ + pass + + async def test_customers_customer_id_contacts_id_get(self) -> None: + """Test case for customers_customer_id_contacts_id_get + + Fetch contact + """ + pass + + async def test_customers_customer_id_contacts_id_put(self) -> None: + """Test case for customers_customer_id_contacts_id_put + + Update Contact + """ + pass + + async def test_customers_customer_id_contacts_post(self) -> None: + """Test case for customers_customer_id_contacts_post + + Create new contact + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_contacts.py b/generated/sync/test/test_contacts.py new file mode 100644 index 0000000..c7240d2 --- /dev/null +++ b/generated/sync/test/test_contacts.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.contacts import Contacts + +class TestContacts(unittest.TestCase): + """Contacts unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Contacts: + """Test Contacts + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Contacts` + """ + model = Contacts() + if include_optional: + return Contacts( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.contact.Contact( + city = 'Musterstadt', + state = 'NRW', + company_name = 'Musterfirma GmbH', + country = 'DE', + department = 'null', + emails = [ + 'mustermann@easybill.de' + ], + fax = 'null', + first_name = 'null', + id = 56, + last_name = 'null', + login_id = 56, + mobile = 'null', + note = 'null', + personal = True, + phone_1 = 'null', + phone_2 = 'null', + salutation = 56, + street = 'Musterstr.', + suffix_1 = 'null', + suffix_2 = 'null', + title = 'null', + zip_code = 'null', + created_at = '2018-01-01 23:23:45', + updated_at = '2018-01-01 23:23:45', ) + ] + ) + else: + return Contacts( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testContacts(self): + """Test Contacts""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_customer.py b/generated/sync/test/test_customer.py new file mode 100644 index 0000000..90b79d6 --- /dev/null +++ b/generated/sync/test/test_customer.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.customer import Customer + +class TestCustomer(unittest.TestCase): + """Customer unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Customer: + """Test Customer + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Customer` + """ + model = Customer() + if include_optional: + return Customer( + acquire_options = 5, + additional_groups_ids = [], + bank_account = '123456789', + bank_account_owner = 'Max Mustermann', + bank_bic = 'DEUTDEFF', + bank_code = '50070024', + bank_iban = 'DE89370400440532013000', + bank_name = 'Musterbank', + birth_date = 'Sat Dec 31 00:00:00 UTC 2016', + cash_allowance = 2.0, + cash_allowance_days = 7, + cash_discount = 3.0, + cash_discount_type = 'PERCENT', + city = 'Kaarst', + state = 'NRW', + company_name = 'easybill GmbH', + country = 'DE', + created_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + updated_at = '', + delivery_title = 'Dr.', + delivery_city = 'Hamburg', + delivery_state = 'NRW', + delivery_company_name = 'Musterfirma Logistik GmbH', + delivery_country = 'DE', + delivery_first_name = 'Erika', + delivery_last_name = 'Musterfrau', + delivery_personal = False, + delivery_salutation = 56, + delivery_street = 'Lieferstraße 42', + delivery_suffix_1 = 'Hinterhaus', + delivery_suffix_2 = '3. Etage', + delivery_zip_code = '20095', + display_name = '', + emails = [max.mustermann@easybill.de], + fax = '+49 2154 89701 29', + first_name = 'Max', + grace_period = 14, + due_in_days = 14, + group_id = 1, + id = 56, + info_1 = 'Kundennummer: 12345', + info_2 = 'Abteilung: Einkauf', + internet = 'https://www.easybill.de', + last_name = 'Mustermann', + login_id = 56, + mobile = '+49 170 1234567', + note = 'Wichtiger Kunde, bevorzugte Betreuung', + number = '', + supplier_number = '', + payment_options = 1, + personal = False, + phone_1 = '+49 2154 89701 20', + phone_2 = '+49 2154 89701 21', + postbox = 'Postfach 1234', + postbox_city = 'Düsseldorf', + postbox_state = 'NRW', + postbox_country = 'DE', + postbox_zip_code = '40213', + sale_price_level = 'SALEPRICE3', + salutation = 56, + sepa_agreement = 'BASIC', + sepa_agreement_date = 'Sat Jan 15 00:00:00 UTC 2022', + sepa_mandate_reference = 'MANDAT-2022-0815', + since_date = 'Sun Mar 01 00:00:00 UTC 2020', + street = 'Düsselstr. 21', + suffix_1 = 'c/o Musterfirma GmbH', + suffix_2 = '2. Stock, links', + tax_number = '21/815/08150', + court = 'Berlin', + court_registry_number = 'HRB XXXXX X', + tax_options = 'IG', + title = 'Dr.', + archived = False, + vat_identifier = 'DE814878557', + zip_code = '41564', + document_pdf_type = 'default', + buyer_reference = '', + foreign_supplier_number = '' + ) + else: + return Customer( + company_name = 'easybill GmbH', + last_name = 'Mustermann', + ) + """ + + def testCustomer(self): + """Test Customer""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_customer_api.py b/generated/sync/test/test_customer_api.py new file mode 100644 index 0000000..82506c2 --- /dev/null +++ b/generated/sync/test/test_customer_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.customer_api import CustomerApi + + +class TestCustomerApi(unittest.IsolatedAsyncioTestCase): + """CustomerApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = CustomerApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_customers_get(self) -> None: + """Test case for customers_get + + Fetch customers list + """ + pass + + async def test_customers_id_delete(self) -> None: + """Test case for customers_id_delete + + Delete customer + """ + pass + + async def test_customers_id_get(self) -> None: + """Test case for customers_id_get + + Fetch customer + """ + pass + + async def test_customers_id_put(self) -> None: + """Test case for customers_id_put + + Update Customer + """ + pass + + async def test_customers_post(self) -> None: + """Test case for customers_post + + Create customer + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_customer_group.py b/generated/sync/test/test_customer_group.py new file mode 100644 index 0000000..bf4846a --- /dev/null +++ b/generated/sync/test/test_customer_group.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.customer_group import CustomerGroup + +class TestCustomerGroup(unittest.TestCase): + """CustomerGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CustomerGroup: + """Test CustomerGroup + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CustomerGroup` + """ + model = CustomerGroup() + if include_optional: + return CustomerGroup( + name = 'Important Customers', + description = 'null', + number = '001', + display_name = '001 - Important Customers', + id = 56 + ) + else: + return CustomerGroup( + name = 'Important Customers', + number = '001', + ) + """ + + def testCustomerGroup(self): + """Test CustomerGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_customer_group_api.py b/generated/sync/test/test_customer_group_api.py new file mode 100644 index 0000000..9592514 --- /dev/null +++ b/generated/sync/test/test_customer_group_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.customer_group_api import CustomerGroupApi + + +class TestCustomerGroupApi(unittest.IsolatedAsyncioTestCase): + """CustomerGroupApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = CustomerGroupApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_customer_groups_get(self) -> None: + """Test case for customer_groups_get + + Fetch customer group list + """ + pass + + async def test_customer_groups_id_delete(self) -> None: + """Test case for customer_groups_id_delete + + Delete customer group + """ + pass + + async def test_customer_groups_id_get(self) -> None: + """Test case for customer_groups_id_get + + Fetch customer group + """ + pass + + async def test_customer_groups_id_put(self) -> None: + """Test case for customer_groups_id_put + + Update customer group + """ + pass + + async def test_customer_groups_post(self) -> None: + """Test case for customer_groups_post + + Create customer group + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_customer_groups.py b/generated/sync/test/test_customer_groups.py new file mode 100644 index 0000000..44979aa --- /dev/null +++ b/generated/sync/test/test_customer_groups.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.customer_groups import CustomerGroups + +class TestCustomerGroups(unittest.TestCase): + """CustomerGroups unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CustomerGroups: + """Test CustomerGroups + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CustomerGroups` + """ + model = CustomerGroups() + if include_optional: + return CustomerGroups( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.customer_group.CustomerGroup( + name = 'Important Customers', + description = 'null', + number = '001', + display_name = '001 - Important Customers', + id = 56, ) + ] + ) + else: + return CustomerGroups( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testCustomerGroups(self): + """Test CustomerGroups""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_customer_snapshot.py b/generated/sync/test/test_customer_snapshot.py new file mode 100644 index 0000000..0686d42 --- /dev/null +++ b/generated/sync/test/test_customer_snapshot.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.customer_snapshot import CustomerSnapshot + +class TestCustomerSnapshot(unittest.TestCase): + """CustomerSnapshot unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CustomerSnapshot: + """Test CustomerSnapshot + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CustomerSnapshot` + """ + model = CustomerSnapshot() + if include_optional: + return CustomerSnapshot( + acquire_options = 5, + additional_groups_ids = [], + bank_account = '123456789', + bank_account_owner = 'Max Mustermann', + bank_bic = 'DEUTDEFF', + bank_code = '50070024', + bank_iban = 'DE89370400440532013000', + bank_name = 'Musterbank', + birth_date = 'Sat Dec 31 00:00:00 UTC 2016', + cash_allowance = 2.0, + cash_allowance_days = 7, + cash_discount = 3.0, + cash_discount_type = 'PERCENT', + city = 'Kaarst', + state = 'NRW', + company_name = 'easybill GmbH', + country = 'DE', + created_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + updated_at = '', + delivery_title = 'Dr.', + delivery_city = 'Hamburg', + delivery_state = 'NRW', + delivery_company_name = 'Musterfirma Logistik GmbH', + delivery_country = 'DE', + delivery_first_name = 'Erika', + delivery_last_name = 'Musterfrau', + delivery_personal = False, + delivery_salutation = 56, + delivery_street = 'Lieferstraße 42', + delivery_suffix_1 = 'Hinterhaus', + delivery_suffix_2 = '3. Etage', + delivery_zip_code = '20095', + display_name = '', + emails = [max.mustermann@easybill.de], + fax = '+49 2154 89701 29', + first_name = 'Max', + grace_period = 14, + due_in_days = 14, + group_id = 1, + id = 56, + info_1 = 'Kundennummer: 12345', + info_2 = 'Abteilung: Einkauf', + internet = 'https://www.easybill.de', + last_name = 'Mustermann', + login_id = 56, + mobile = '+49 170 1234567', + note = 'Wichtiger Kunde, bevorzugte Betreuung', + number = '', + supplier_number = '', + payment_options = 1, + personal = False, + phone_1 = '+49 2154 89701 20', + phone_2 = '+49 2154 89701 21', + postbox = 'Postfach 1234', + postbox_city = 'Düsseldorf', + postbox_state = 'NRW', + postbox_country = 'DE', + postbox_zip_code = '40213', + sale_price_level = 'SALEPRICE3', + salutation = 56, + sepa_agreement = 'BASIC', + sepa_agreement_date = 'Sat Jan 15 00:00:00 UTC 2022', + sepa_mandate_reference = 'MANDAT-2022-0815', + since_date = 'Sun Mar 01 00:00:00 UTC 2020', + street = 'Düsselstr. 21', + suffix_1 = 'c/o Musterfirma GmbH', + suffix_2 = '2. Stock, links', + tax_number = '21/815/08150', + court = 'Berlin', + court_registry_number = 'HRB XXXXX X', + tax_options = 'IG', + title = 'Dr.', + archived = False, + vat_identifier = 'DE814878557', + zip_code = '41564', + document_pdf_type = 'default', + buyer_reference = '', + foreign_supplier_number = '' + ) + else: + return CustomerSnapshot( + company_name = 'easybill GmbH', + last_name = 'Mustermann', + ) + """ + + def testCustomerSnapshot(self): + """Test CustomerSnapshot""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_customers.py b/generated/sync/test/test_customers.py new file mode 100644 index 0000000..93c1df5 --- /dev/null +++ b/generated/sync/test/test_customers.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.customers import Customers + +class TestCustomers(unittest.TestCase): + """Customers unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Customers: + """Test Customers + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Customers` + """ + model = Customers() + if include_optional: + return Customers( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.customer.Customer( + acquire_options = 5, + additional_groups_ids = [], + bank_account = '123456789', + bank_account_owner = 'Max Mustermann', + bank_bic = 'DEUTDEFF', + bank_code = '50070024', + bank_iban = 'DE89370400440532013000', + bank_name = 'Musterbank', + birth_date = 'Sat Dec 31 00:00:00 UTC 2016', + cash_allowance = 2.0, + cash_allowance_days = 7, + cash_discount = 3.0, + cash_discount_type = 'PERCENT', + city = 'Kaarst', + state = 'NRW', + company_name = 'easybill GmbH', + country = 'DE', + created_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + updated_at = '', + delivery_title = 'Dr.', + delivery_city = 'Hamburg', + delivery_state = 'NRW', + delivery_company_name = 'Musterfirma Logistik GmbH', + delivery_country = 'DE', + delivery_first_name = 'Erika', + delivery_last_name = 'Musterfrau', + delivery_personal = False, + delivery_salutation = 56, + delivery_street = 'Lieferstraße 42', + delivery_suffix_1 = 'Hinterhaus', + delivery_suffix_2 = '3. Etage', + delivery_zip_code = '20095', + display_name = '', + emails = [max.mustermann@easybill.de], + fax = '+49 2154 89701 29', + first_name = 'Max', + grace_period = 14, + due_in_days = 14, + group_id = 1, + id = 56, + info_1 = 'Kundennummer: 12345', + info_2 = 'Abteilung: Einkauf', + internet = 'https://www.easybill.de', + last_name = 'Mustermann', + login_id = 56, + mobile = '+49 170 1234567', + note = 'Wichtiger Kunde, bevorzugte Betreuung', + number = '', + supplier_number = '', + payment_options = 1, + personal = False, + phone_1 = '+49 2154 89701 20', + phone_2 = '+49 2154 89701 21', + postbox = 'Postfach 1234', + postbox_city = 'Düsseldorf', + postbox_state = 'NRW', + postbox_country = 'DE', + postbox_zip_code = '40213', + sale_price_level = 'SALEPRICE3', + salutation = 56, + sepa_agreement = 'BASIC', + sepa_agreement_date = 'Sat Jan 15 00:00:00 UTC 2022', + sepa_mandate_reference = 'MANDAT-2022-0815', + since_date = 'Sun Mar 01 00:00:00 UTC 2020', + street = 'Düsselstr. 21', + suffix_1 = 'c/o Musterfirma GmbH', + suffix_2 = '2. Stock, links', + tax_number = '21/815/08150', + court = 'Berlin', + court_registry_number = 'HRB XXXXX X', + tax_options = 'IG', + title = 'Dr.', + archived = False, + vat_identifier = 'DE814878557', + zip_code = '41564', + document_pdf_type = 'default', + buyer_reference = '', + foreign_supplier_number = '', ) + ] + ) + else: + return Customers( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testCustomers(self): + """Test Customers""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_discount.py b/generated/sync/test/test_discount.py new file mode 100644 index 0000000..e7cf6c9 --- /dev/null +++ b/generated/sync/test/test_discount.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.discount import Discount + +class TestDiscount(unittest.TestCase): + """Discount unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Discount: + """Test Discount + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Discount` + """ + model = Discount() + if include_optional: + return Discount( + id = 56, + customer_id = 56, + discount = 10, + discount_type = 'PERCENT' + ) + else: + return Discount( + customer_id = 56, + ) + """ + + def testDiscount(self): + """Test Discount""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_discount_api.py b/generated/sync/test/test_discount_api.py new file mode 100644 index 0000000..95903de --- /dev/null +++ b/generated/sync/test/test_discount_api.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.discount_api import DiscountApi + + +class TestDiscountApi(unittest.IsolatedAsyncioTestCase): + """DiscountApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = DiscountApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_discounts_position_get(self) -> None: + """Test case for discounts_position_get + + Fetch list of position discounts + """ + pass + + async def test_discounts_position_group_get(self) -> None: + """Test case for discounts_position_group_get + + Fetch list of position-group discounts + """ + pass + + async def test_discounts_position_group_id_delete(self) -> None: + """Test case for discounts_position_group_id_delete + + Delete the specified position-group discount + """ + pass + + async def test_discounts_position_group_id_get(self) -> None: + """Test case for discounts_position_group_id_get + + Fetch specified position-group discount by id + """ + pass + + async def test_discounts_position_group_id_put(self) -> None: + """Test case for discounts_position_group_id_put + + Update a position-group discount + """ + pass + + async def test_discounts_position_group_post(self) -> None: + """Test case for discounts_position_group_post + + Create a new position-group discount + """ + pass + + async def test_discounts_position_id_delete(self) -> None: + """Test case for discounts_position_id_delete + + Delete the specified position discount + """ + pass + + async def test_discounts_position_id_get(self) -> None: + """Test case for discounts_position_id_get + + Fetch specified position discount by id + """ + pass + + async def test_discounts_position_id_put(self) -> None: + """Test case for discounts_position_id_put + + Update a position discount + """ + pass + + async def test_discounts_position_post(self) -> None: + """Test case for discounts_position_post + + Create a new position discount + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_discount_position.py b/generated/sync/test/test_discount_position.py new file mode 100644 index 0000000..072c70b --- /dev/null +++ b/generated/sync/test/test_discount_position.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.discount_position import DiscountPosition + +class TestDiscountPosition(unittest.TestCase): + """DiscountPosition unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscountPosition: + """Test DiscountPosition + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscountPosition` + """ + model = DiscountPosition() + if include_optional: + return DiscountPosition( + id = 56, + customer_id = 56, + discount = 10, + discount_type = 'PERCENT', + position_id = 56 + ) + else: + return DiscountPosition( + customer_id = 56, + position_id = 56, + ) + """ + + def testDiscountPosition(self): + """Test DiscountPosition""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_discount_position_group.py b/generated/sync/test/test_discount_position_group.py new file mode 100644 index 0000000..9ae2c28 --- /dev/null +++ b/generated/sync/test/test_discount_position_group.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.discount_position_group import DiscountPositionGroup + +class TestDiscountPositionGroup(unittest.TestCase): + """DiscountPositionGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscountPositionGroup: + """Test DiscountPositionGroup + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscountPositionGroup` + """ + model = DiscountPositionGroup() + if include_optional: + return DiscountPositionGroup( + id = 56, + customer_id = 56, + discount = 10, + discount_type = 'PERCENT', + position_group_id = 56 + ) + else: + return DiscountPositionGroup( + customer_id = 56, + position_group_id = 56, + ) + """ + + def testDiscountPositionGroup(self): + """Test DiscountPositionGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_discount_position_groups.py b/generated/sync/test/test_discount_position_groups.py new file mode 100644 index 0000000..ab9cc72 --- /dev/null +++ b/generated/sync/test/test_discount_position_groups.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.discount_position_groups import DiscountPositionGroups + +class TestDiscountPositionGroups(unittest.TestCase): + """DiscountPositionGroups unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscountPositionGroups: + """Test DiscountPositionGroups + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscountPositionGroups` + """ + model = DiscountPositionGroups() + if include_optional: + return DiscountPositionGroups( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + null + ] + ) + else: + return DiscountPositionGroups( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testDiscountPositionGroups(self): + """Test DiscountPositionGroups""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_discount_positions.py b/generated/sync/test/test_discount_positions.py new file mode 100644 index 0000000..0540838 --- /dev/null +++ b/generated/sync/test/test_discount_positions.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.discount_positions import DiscountPositions + +class TestDiscountPositions(unittest.TestCase): + """DiscountPositions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DiscountPositions: + """Test DiscountPositions + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DiscountPositions` + """ + model = DiscountPositions() + if include_optional: + return DiscountPositions( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + null + ] + ) + else: + return DiscountPositions( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testDiscountPositions(self): + """Test DiscountPositions""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_document.py b/generated/sync/test/test_document.py new file mode 100644 index 0000000..1edb2fd --- /dev/null +++ b/generated/sync/test/test_document.py @@ -0,0 +1,212 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.document import Document + +class TestDocument(unittest.TestCase): + """Document unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Document: + """Test Document + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Document` + """ + model = Document() + if include_optional: + return Document( + address = easybill_generated_sync.models.document_address.DocumentAddress( + salutation = 56, + personal = False, + title = 'Dr.', + first_name = 'Max', + last_name = 'Mustermann', + suffix_1 = 'Abteilung Vertrieb', + suffix_2 = '3. Etage', + company_name = 'Musterunternehmen AG', + street = 'Musterstr.', + zip_code = '12345', + city = 'Musterstadt', + state = 'NRW', + country = 'DE', ), + advanced_data_fields = [], + attachment_ids = [], + label_address = easybill_generated_sync.models.document_address.DocumentAddress( + salutation = 56, + personal = False, + title = 'Dr.', + first_name = 'Max', + last_name = 'Mustermann', + suffix_1 = 'Abteilung Vertrieb', + suffix_2 = '3. Etage', + company_name = 'Musterunternehmen AG', + street = 'Musterstr.', + zip_code = '12345', + city = 'Musterstadt', + state = 'NRW', + country = 'DE', ), + amount = 56, + amount_net = 56, + anonymize_due_date = 'Thu Feb 07 00:00:00 UTC 2019', + anonymize_status = 'NOT_ANONYMIZED', + anonymized_at = '2019-02-07 00:00:00', + bank_debit_form = 'null', + billing_country = 'null', + calc_vat_from = 0, + cancel_id = 56, + cash_allowance = 1.337, + cash_allowance_days = 56, + cash_allowance_text = 'null', + contact_id = 56, + contact_label = '', + contact_text = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + currency = 'EUR', + customer_id = 56, + customer_snapshot = None, + discount = 'null', + discount_type = 'PERCENT', + document_date = 'Thu Feb 07 00:00:00 UTC 2019', + due_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + edited_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + external_id = 'null', + replica_url = 'null', + grace_period = 56, + due_in_days = 56, + id = 56, + is_acceptable_on_public_domain = False, + is_archive = False, + is_draft = True, + is_replica = False, + is_oss = False, + item_notes = [ + '' + ], + items = [ + easybill_generated_sync.models.document_position.DocumentPosition( + number = 'null', + description = 'null', + document_note = 'Test Note', + quantity = 1.0, + quantity_str = '1:30 h', + unit = 'null', + type = 'POSITION', + position = 1, + single_price_net = 75.0, + single_price_gross = 1.337, + vat_percent = 0.0, + discount = 10.0, + discount_type = 'PERCENT', + position_id = 123456, + total_price_net = 1.337, + total_price_gross = 1.337, + total_vat = 1.337, + serial_number_id = 'SN-2023-001-ID', + serial_number = 'SN-2023-001', + booking_account = 'null', + export_cost_1 = 'null', + export_cost_2 = 'null', + cost_price_net = 45.5, + cost_price_total = 45.5, + cost_price_charge = 10.0, + cost_price_charge_type = 'PERCENT', + item_type = 'UNDEFINED', + id = 56, ) + ], + last_postbox_id = 56, + login_id = 56, + number = 'null', + order_number = '', + buyer_reference = '', + paid_amount = 56, + paid_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + pdf_pages = 56, + pdf_template = 'null', + payment_link_enabled = False, + payment_link_locale = 'de', + project_id = 56, + recurring_options = easybill_generated_sync.models.document_recurring.DocumentRecurring( + next_date = 'Sat Feb 01 00:00:00 UTC 2020', + frequency = 'MONTHLY', + frequency_special = 'LASTDAYOFMONTH', + interval = 1, + end_date_or_count = 'null', + status = 'WAITING', + as_draft = True, + is_notify = True, + send_as = 'EMAIL', + is_sign = True, + is_paid = True, + paid_date_option = 'created_date', + is_sepa = True, + sepa_local_instrument = 'CORE', + sepa_sequence_type = 'FRST', + sepa_reference = 'null', + sepa_remittance_information = 'null', + target_type = 'INVOICE', ), + ref_id = 56, + root_id = 56, + service_date = easybill_generated_sync.models.service_date.ServiceDate( + type = 'DEFAULT', + date = 'Fri Feb 01 00:00:00 UTC 2019', + date_from = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + date_to = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + text = 'null', ), + shipping_country = 'null', + status = 'ACCEPT', + text = 'Vielen Dank für Ihren Auftrag! + +Bitte begleichen Sie den offenen Betrag bis zum %DOKUMENT.DATUM-FAELLIG%. + +Mit freundlichen Grüßen + +%FIRMA.FIRMA% +', + text_prefix = '%KUNDE.ANREDE%, +nachfolgend berechnen wir Ihnen wie vorab besprochen: +', + text_tax = 'null', + title = 'null', + type = 'INVOICE', + use_shipping_address = False, + vat_country = 'null', + vat_id = '', + fulfillment_country = 'null', + vat_option = 'NULL', + file_format_config = [ + easybill_generated_sync.models.file_format_config.FileFormatConfig( + type = 'default', ) + ] + ) + else: + return Document( + ) + """ + + def testDocument(self): + """Test Document""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_document_address.py b/generated/sync/test/test_document_address.py new file mode 100644 index 0000000..17c83f4 --- /dev/null +++ b/generated/sync/test/test_document_address.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.document_address import DocumentAddress + +class TestDocumentAddress(unittest.TestCase): + """DocumentAddress unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentAddress: + """Test DocumentAddress + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentAddress` + """ + model = DocumentAddress() + if include_optional: + return DocumentAddress( + salutation = 56, + personal = False, + title = 'Dr.', + first_name = 'Max', + last_name = 'Mustermann', + suffix_1 = 'Abteilung Vertrieb', + suffix_2 = '3. Etage', + company_name = 'Musterunternehmen AG', + street = 'Musterstr.', + zip_code = '12345', + city = 'Musterstadt', + state = 'NRW', + country = 'DE' + ) + else: + return DocumentAddress( + ) + """ + + def testDocumentAddress(self): + """Test DocumentAddress""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_document_api.py b/generated/sync/test/test_document_api.py new file mode 100644 index 0000000..81c2233 --- /dev/null +++ b/generated/sync/test/test_document_api.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.document_api import DocumentApi + + +class TestDocumentApi(unittest.IsolatedAsyncioTestCase): + """DocumentApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = DocumentApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_documents_get(self) -> None: + """Test case for documents_get + + Fetch documents list + """ + pass + + async def test_documents_id_cancel_post(self) -> None: + """Test case for documents_id_cancel_post + + Cancel document + """ + pass + + async def test_documents_id_delete(self) -> None: + """Test case for documents_id_delete + + Delete document + """ + pass + + async def test_documents_id_done_put(self) -> None: + """Test case for documents_id_done_put + + To complete a document. + """ + pass + + async def test_documents_id_download_get(self) -> None: + """Test case for documents_id_download_get + + Fetch the document in best fitting format to the given Accept header + """ + pass + + async def test_documents_id_get(self) -> None: + """Test case for documents_id_get + + Fetch document + """ + pass + + async def test_documents_id_jpg_get(self) -> None: + """Test case for documents_id_jpg_get + + Download a document as an jpeg-image + """ + pass + + async def test_documents_id_pdf_get(self) -> None: + """Test case for documents_id_pdf_get + + Fetch pdf document + """ + pass + + async def test_documents_id_put(self) -> None: + """Test case for documents_id_put + + Update document + """ + pass + + async def test_documents_id_send_type_post(self) -> None: + """Test case for documents_id_send_type_post + + Send document + """ + pass + + async def test_documents_id_type_post(self) -> None: + """Test case for documents_id_type_post + + Convert an existing document to one of a different type + """ + pass + + async def test_documents_post(self) -> None: + """Test case for documents_post + + Create document + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_document_payment.py b/generated/sync/test/test_document_payment.py new file mode 100644 index 0000000..6c40f0e --- /dev/null +++ b/generated/sync/test/test_document_payment.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.document_payment import DocumentPayment + +class TestDocumentPayment(unittest.TestCase): + """DocumentPayment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentPayment: + """Test DocumentPayment + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentPayment` + """ + model = DocumentPayment() + if include_optional: + return DocumentPayment( + amount = 56, + document_id = 56, + id = 56, + is_overdue_fee = True, + login_id = 56, + notice = '', + payment_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + type = '', + provider = '', + reference = '' + ) + else: + return DocumentPayment( + amount = 56, + document_id = 56, + ) + """ + + def testDocumentPayment(self): + """Test DocumentPayment""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_document_payment_api.py b/generated/sync/test/test_document_payment_api.py new file mode 100644 index 0000000..7faa8e0 --- /dev/null +++ b/generated/sync/test/test_document_payment_api.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.document_payment_api import DocumentPaymentApi + + +class TestDocumentPaymentApi(unittest.IsolatedAsyncioTestCase): + """DocumentPaymentApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = DocumentPaymentApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_document_payments_get(self) -> None: + """Test case for document_payments_get + + Fetch document payments list + """ + pass + + async def test_document_payments_id_delete(self) -> None: + """Test case for document_payments_id_delete + + Delete document payment + """ + pass + + async def test_document_payments_id_get(self) -> None: + """Test case for document_payments_id_get + + Fetch document payment + """ + pass + + async def test_document_payments_post(self) -> None: + """Test case for document_payments_post + + Create document payment + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_document_payments.py b/generated/sync/test/test_document_payments.py new file mode 100644 index 0000000..8e659a5 --- /dev/null +++ b/generated/sync/test/test_document_payments.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.document_payments import DocumentPayments + +class TestDocumentPayments(unittest.TestCase): + """DocumentPayments unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentPayments: + """Test DocumentPayments + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentPayments` + """ + model = DocumentPayments() + if include_optional: + return DocumentPayments( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + {id=1, document_id=1, login_id=1, amount=1000, payment_at=2007-09-17T00:00:00.000Z, type=VISA, provider=Stripe, reference=111111-VISA-222222-6666} + ] + ) + else: + return DocumentPayments( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testDocumentPayments(self): + """Test DocumentPayments""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_document_position.py b/generated/sync/test/test_document_position.py new file mode 100644 index 0000000..80e71e7 --- /dev/null +++ b/generated/sync/test/test_document_position.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.document_position import DocumentPosition + +class TestDocumentPosition(unittest.TestCase): + """DocumentPosition unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentPosition: + """Test DocumentPosition + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentPosition` + """ + model = DocumentPosition() + if include_optional: + return DocumentPosition( + number = 'null', + description = 'null', + document_note = 'Test Note', + quantity = 1.0, + quantity_str = '1:30 h', + unit = 'null', + type = 'POSITION', + position = 1, + single_price_net = 75.0, + single_price_gross = 1.337, + vat_percent = 0.0, + discount = 10.0, + discount_type = 'PERCENT', + position_id = 123456, + total_price_net = 1.337, + total_price_gross = 1.337, + total_vat = 1.337, + serial_number_id = 'SN-2023-001-ID', + serial_number = 'SN-2023-001', + booking_account = 'null', + export_cost_1 = 'null', + export_cost_2 = 'null', + cost_price_net = 45.5, + cost_price_total = 45.5, + cost_price_charge = 10.0, + cost_price_charge_type = 'PERCENT', + item_type = 'UNDEFINED', + id = 56 + ) + else: + return DocumentPosition( + ) + """ + + def testDocumentPosition(self): + """Test DocumentPosition""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_document_recurring.py b/generated/sync/test/test_document_recurring.py new file mode 100644 index 0000000..8fa6b61 --- /dev/null +++ b/generated/sync/test/test_document_recurring.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.document_recurring import DocumentRecurring + +class TestDocumentRecurring(unittest.TestCase): + """DocumentRecurring unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentRecurring: + """Test DocumentRecurring + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentRecurring` + """ + model = DocumentRecurring() + if include_optional: + return DocumentRecurring( + next_date = 'Sat Feb 01 00:00:00 UTC 2020', + frequency = 'MONTHLY', + frequency_special = 'LASTDAYOFMONTH', + interval = 1, + end_date_or_count = 'null', + status = 'WAITING', + as_draft = True, + is_notify = True, + send_as = 'EMAIL', + is_sign = True, + is_paid = True, + paid_date_option = 'created_date', + is_sepa = True, + sepa_local_instrument = 'CORE', + sepa_sequence_type = 'FRST', + sepa_reference = 'null', + sepa_remittance_information = 'null', + target_type = 'INVOICE' + ) + else: + return DocumentRecurring( + next_date = 'Sat Feb 01 00:00:00 UTC 2020', + ) + """ + + def testDocumentRecurring(self): + """Test DocumentRecurring""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_document_version.py b/generated/sync/test/test_document_version.py new file mode 100644 index 0000000..54774ad --- /dev/null +++ b/generated/sync/test/test_document_version.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.document_version import DocumentVersion + +class TestDocumentVersion(unittest.TestCase): + """DocumentVersion unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentVersion: + """Test DocumentVersion + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentVersion` + """ + model = DocumentVersion() + if include_optional: + return DocumentVersion( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + document_id = 56, + id = 56, + items = [ + easybill_generated_sync.models.document_version_item.DocumentVersionItem( + document_version_item_type = 'default', + id = 56, ) + ], + reason = 'Added another position to the document' + ) + else: + return DocumentVersion( + ) + """ + + def testDocumentVersion(self): + """Test DocumentVersion""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_document_version_api.py b/generated/sync/test/test_document_version_api.py new file mode 100644 index 0000000..71f2e66 --- /dev/null +++ b/generated/sync/test/test_document_version_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.document_version_api import DocumentVersionApi + + +class TestDocumentVersionApi(unittest.IsolatedAsyncioTestCase): + """DocumentVersionApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = DocumentVersionApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_documents_id_versions_get(self) -> None: + """Test case for documents_id_versions_get + + List all versions of a given document + """ + pass + + async def test_documents_id_versions_version_id_get(self) -> None: + """Test case for documents_id_versions_version_id_get + + Show a single version of a given document + """ + pass + + async def test_documents_id_versions_version_id_items_version_item_id_download_get(self) -> None: + """Test case for documents_id_versions_version_id_items_version_item_id_download_get + + Download a specific file for a single version of a given document + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_document_version_item.py b/generated/sync/test/test_document_version_item.py new file mode 100644 index 0000000..9b580e9 --- /dev/null +++ b/generated/sync/test/test_document_version_item.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.document_version_item import DocumentVersionItem + +class TestDocumentVersionItem(unittest.TestCase): + """DocumentVersionItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentVersionItem: + """Test DocumentVersionItem + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentVersionItem` + """ + model = DocumentVersionItem() + if include_optional: + return DocumentVersionItem( + document_version_item_type = 'default', + id = 56 + ) + else: + return DocumentVersionItem( + ) + """ + + def testDocumentVersionItem(self): + """Test DocumentVersionItem""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_document_versions.py b/generated/sync/test/test_document_versions.py new file mode 100644 index 0000000..830b0e4 --- /dev/null +++ b/generated/sync/test/test_document_versions.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.document_versions import DocumentVersions + +class TestDocumentVersions(unittest.TestCase): + """DocumentVersions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocumentVersions: + """Test DocumentVersions + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DocumentVersions` + """ + model = DocumentVersions() + if include_optional: + return DocumentVersions( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.document_version.DocumentVersion( + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + document_id = 56, + id = 56, + items = [ + easybill_generated_sync.models.document_version_item.DocumentVersionItem( + document_version_item_type = 'default', + id = 56, ) + ], + reason = 'Added another position to the document', ) + ] + ) + else: + return DocumentVersions( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testDocumentVersions(self): + """Test DocumentVersions""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_documents.py b/generated/sync/test/test_documents.py new file mode 100644 index 0000000..0a516ce --- /dev/null +++ b/generated/sync/test/test_documents.py @@ -0,0 +1,223 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.documents import Documents + +class TestDocuments(unittest.TestCase): + """Documents unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Documents: + """Test Documents + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Documents` + """ + model = Documents() + if include_optional: + return Documents( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.document.Document( + address = easybill_generated_sync.models.document_address.DocumentAddress( + salutation = 56, + personal = False, + title = 'Dr.', + first_name = 'Max', + last_name = 'Mustermann', + suffix_1 = 'Abteilung Vertrieb', + suffix_2 = '3. Etage', + company_name = 'Musterunternehmen AG', + street = 'Musterstr.', + zip_code = '12345', + city = 'Musterstadt', + state = 'NRW', + country = 'DE', ), + advanced_data_fields = [], + attachment_ids = [], + label_address = easybill_generated_sync.models.document_address.DocumentAddress( + salutation = 56, + personal = False, + title = 'Dr.', + first_name = 'Max', + last_name = 'Mustermann', + suffix_1 = 'Abteilung Vertrieb', + suffix_2 = '3. Etage', + company_name = 'Musterunternehmen AG', + street = 'Musterstr.', + zip_code = '12345', + city = 'Musterstadt', + state = 'NRW', + country = 'DE', ), + amount = 56, + amount_net = 56, + anonymize_due_date = 'Thu Feb 07 00:00:00 UTC 2019', + anonymize_status = 'NOT_ANONYMIZED', + anonymized_at = '2019-02-07 00:00:00', + bank_debit_form = 'null', + billing_country = 'null', + calc_vat_from = 0, + cancel_id = 56, + cash_allowance = 1.337, + cash_allowance_days = 56, + cash_allowance_text = 'null', + contact_id = 56, + contact_label = '', + contact_text = '', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + currency = 'EUR', + customer_id = 56, + customer_snapshot = null, + discount = 'null', + discount_type = 'PERCENT', + document_date = 'Thu Feb 07 00:00:00 UTC 2019', + due_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + edited_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + external_id = 'null', + replica_url = 'null', + grace_period = 56, + due_in_days = 56, + id = 56, + is_acceptable_on_public_domain = False, + is_archive = False, + is_draft = True, + is_replica = False, + is_oss = False, + item_notes = [ + '' + ], + items = [ + easybill_generated_sync.models.document_position.DocumentPosition( + number = 'null', + description = 'null', + document_note = 'Test Note', + quantity = 1.0, + quantity_str = '1:30 h', + unit = 'null', + type = 'POSITION', + position = 1, + single_price_net = 75.0, + single_price_gross = 1.337, + vat_percent = 0.0, + discount = 10.0, + discount_type = 'PERCENT', + position_id = 123456, + total_price_net = 1.337, + total_price_gross = 1.337, + total_vat = 1.337, + serial_number_id = 'SN-2023-001-ID', + serial_number = 'SN-2023-001', + booking_account = 'null', + export_cost_1 = 'null', + export_cost_2 = 'null', + cost_price_net = 45.5, + cost_price_total = 45.5, + cost_price_charge = 10.0, + cost_price_charge_type = 'PERCENT', + item_type = 'UNDEFINED', + id = 56, ) + ], + last_postbox_id = 56, + login_id = 56, + number = 'null', + order_number = '', + buyer_reference = '', + paid_amount = 56, + paid_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + pdf_pages = 56, + pdf_template = 'null', + payment_link_enabled = False, + payment_link_locale = 'de', + project_id = 56, + recurring_options = easybill_generated_sync.models.document_recurring.DocumentRecurring( + next_date = 'Sat Feb 01 00:00:00 UTC 2020', + frequency = 'MONTHLY', + frequency_special = 'LASTDAYOFMONTH', + interval = 1, + end_date_or_count = 'null', + status = 'WAITING', + as_draft = True, + is_notify = True, + send_as = 'EMAIL', + is_sign = True, + is_paid = True, + paid_date_option = 'created_date', + is_sepa = True, + sepa_local_instrument = 'CORE', + sepa_sequence_type = 'FRST', + sepa_reference = 'null', + sepa_remittance_information = 'null', + target_type = 'INVOICE', ), + ref_id = 56, + root_id = 56, + service_date = easybill_generated_sync.models.service_date.ServiceDate( + type = 'DEFAULT', + date = 'Fri Feb 01 00:00:00 UTC 2019', + date_from = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + date_to = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + text = 'null', ), + shipping_country = 'null', + status = 'ACCEPT', + text = 'Vielen Dank für Ihren Auftrag! + +Bitte begleichen Sie den offenen Betrag bis zum %DOKUMENT.DATUM-FAELLIG%. + +Mit freundlichen Grüßen + +%FIRMA.FIRMA% +', + text_prefix = '%KUNDE.ANREDE%, +nachfolgend berechnen wir Ihnen wie vorab besprochen: +', + text_tax = 'null', + title = 'null', + type = 'INVOICE', + use_shipping_address = False, + vat_country = 'null', + vat_id = '', + fulfillment_country = 'null', + vat_option = 'NULL', + file_format_config = [ + easybill_generated_sync.models.file_format_config.FileFormatConfig( + type = 'default', ) + ], ) + ] + ) + else: + return Documents( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testDocuments(self): + """Test Documents""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_file_format_config.py b/generated/sync/test/test_file_format_config.py new file mode 100644 index 0000000..a14168a --- /dev/null +++ b/generated/sync/test/test_file_format_config.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.file_format_config import FileFormatConfig + +class TestFileFormatConfig(unittest.TestCase): + """FileFormatConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FileFormatConfig: + """Test FileFormatConfig + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `FileFormatConfig` + """ + model = FileFormatConfig() + if include_optional: + return FileFormatConfig( + type = 'default' + ) + else: + return FileFormatConfig( + type = 'default', + ) + """ + + def testFileFormatConfig(self): + """Test FileFormatConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_list.py b/generated/sync/test/test_list.py new file mode 100644 index 0000000..03a42ea --- /dev/null +++ b/generated/sync/test/test_list.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.list import List + +class TestList(unittest.TestCase): + """List unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> List: + """Test List + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `List` + """ + model = List() + if include_optional: + return List( + page = 1, + pages = 1, + limit = 100, + total = 20 + ) + else: + return List( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testList(self): + """Test List""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_login.py b/generated/sync/test/test_login.py new file mode 100644 index 0000000..951eb29 --- /dev/null +++ b/generated/sync/test/test_login.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.login import Login + +class TestLogin(unittest.TestCase): + """Login unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Login: + """Test Login + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Login` + """ + model = Login() + if include_optional: + return Login( + id = 56, + first_name = 'Max', + last_name = 'Musterfrau', + display_name = 'Max Musterfrau', + phone = '+4923489342', + email = 'example@easybill.de', + email_signature = 'null', + login_type = 'ASSISTANT', + locale = 'de', + time_zone = 'Europe/Berlin', + security = easybill_generated_sync.models.login_security.LoginSecurity( + two_factor_enabled = True, + recovery_codes_enabled = True, + notify_on_new_login_enabled = True, ) + ) + else: + return Login( + ) + """ + + def testLogin(self): + """Test Login""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_login_security.py b/generated/sync/test/test_login_security.py new file mode 100644 index 0000000..a1b7280 --- /dev/null +++ b/generated/sync/test/test_login_security.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.login_security import LoginSecurity + +class TestLoginSecurity(unittest.TestCase): + """LoginSecurity unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> LoginSecurity: + """Test LoginSecurity + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `LoginSecurity` + """ + model = LoginSecurity() + if include_optional: + return LoginSecurity( + two_factor_enabled = True, + recovery_codes_enabled = True, + notify_on_new_login_enabled = True + ) + else: + return LoginSecurity( + ) + """ + + def testLoginSecurity(self): + """Test LoginSecurity""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_logins.py b/generated/sync/test/test_logins.py new file mode 100644 index 0000000..0bea4f4 --- /dev/null +++ b/generated/sync/test/test_logins.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.logins import Logins + +class TestLogins(unittest.TestCase): + """Logins unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Logins: + """Test Logins + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Logins` + """ + model = Logins() + if include_optional: + return Logins( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.login.Login( + id = 56, + first_name = 'Max', + last_name = 'Musterfrau', + display_name = 'Max Musterfrau', + phone = '+4923489342', + email = 'example@easybill.de', + email_signature = 'null', + login_type = 'ASSISTANT', + locale = 'de', + time_zone = 'Europe/Berlin', + security = easybill_generated_sync.models.login_security.LoginSecurity( + two_factor_enabled = True, + recovery_codes_enabled = True, + notify_on_new_login_enabled = True, ), ) + ] + ) + else: + return Logins( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testLogins(self): + """Test Logins""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_logins_api.py b/generated/sync/test/test_logins_api.py new file mode 100644 index 0000000..bb4e010 --- /dev/null +++ b/generated/sync/test/test_logins_api.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.logins_api import LoginsApi + + +class TestLoginsApi(unittest.IsolatedAsyncioTestCase): + """LoginsApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = LoginsApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_logins_get(self) -> None: + """Test case for logins_get + + """ + pass + + async def test_logins_id_get(self) -> None: + """Test case for logins_id_get + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_pdf_template.py b/generated/sync/test/test_pdf_template.py new file mode 100644 index 0000000..32710ee --- /dev/null +++ b/generated/sync/test/test_pdf_template.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.pdf_template import PDFTemplate + +class TestPDFTemplate(unittest.TestCase): + """PDFTemplate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PDFTemplate: + """Test PDFTemplate + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PDFTemplate` + """ + model = PDFTemplate() + if include_optional: + return PDFTemplate( + id = 'INVOICE-DE', + name = 'Default template', + pdf_template = 'DE', + document_type = 'INVOICE', + settings = easybill_generated_sync.models.pdf_template_settings.PDFTemplate_settings( + text_prefix = '', + text = '', + email = easybill_generated_sync.models.pdf_template_settings_email.PDFTemplate_settings_email( + subject = '', + message = '', ), ) + ) + else: + return PDFTemplate( + ) + """ + + def testPDFTemplate(self): + """Test PDFTemplate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_pdf_template_settings.py b/generated/sync/test/test_pdf_template_settings.py new file mode 100644 index 0000000..a985c0d --- /dev/null +++ b/generated/sync/test/test_pdf_template_settings.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.pdf_template_settings import PDFTemplateSettings + +class TestPDFTemplateSettings(unittest.TestCase): + """PDFTemplateSettings unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PDFTemplateSettings: + """Test PDFTemplateSettings + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PDFTemplateSettings` + """ + model = PDFTemplateSettings() + if include_optional: + return PDFTemplateSettings( + text_prefix = '', + text = '', + email = easybill_generated_sync.models.pdf_template_settings_email.PDFTemplate_settings_email( + subject = '', + message = '', ) + ) + else: + return PDFTemplateSettings( + ) + """ + + def testPDFTemplateSettings(self): + """Test PDFTemplateSettings""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_pdf_template_settings_email.py b/generated/sync/test/test_pdf_template_settings_email.py new file mode 100644 index 0000000..a0e8958 --- /dev/null +++ b/generated/sync/test/test_pdf_template_settings_email.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.pdf_template_settings_email import PDFTemplateSettingsEmail + +class TestPDFTemplateSettingsEmail(unittest.TestCase): + """PDFTemplateSettingsEmail unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PDFTemplateSettingsEmail: + """Test PDFTemplateSettingsEmail + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PDFTemplateSettingsEmail` + """ + model = PDFTemplateSettingsEmail() + if include_optional: + return PDFTemplateSettingsEmail( + subject = '', + message = '' + ) + else: + return PDFTemplateSettingsEmail( + ) + """ + + def testPDFTemplateSettingsEmail(self): + """Test PDFTemplateSettingsEmail""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_pdf_templates.py b/generated/sync/test/test_pdf_templates.py new file mode 100644 index 0000000..eb3458b --- /dev/null +++ b/generated/sync/test/test_pdf_templates.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.pdf_templates import PDFTemplates + +class TestPDFTemplates(unittest.TestCase): + """PDFTemplates unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PDFTemplates: + """Test PDFTemplates + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PDFTemplates` + """ + model = PDFTemplates() + if include_optional: + return PDFTemplates( + items = [ + easybill_generated_sync.models.pdf_template.PDFTemplate( + id = 'INVOICE-DE', + name = 'Default template', + pdf_template = 'DE', + document_type = 'INVOICE', + settings = easybill_generated_sync.models.pdf_template_settings.PDFTemplate_settings( + text_prefix = '', + text = '', + email = easybill_generated_sync.models.pdf_template_settings_email.PDFTemplate_settings_email( + subject = '', + message = '', ), ), ) + ] + ) + else: + return PDFTemplates( + ) + """ + + def testPDFTemplates(self): + """Test PDFTemplates""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_pdf_templates_api.py b/generated/sync/test/test_pdf_templates_api.py new file mode 100644 index 0000000..cac057e --- /dev/null +++ b/generated/sync/test/test_pdf_templates_api.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.pdf_templates_api import PdfTemplatesApi + + +class TestPdfTemplatesApi(unittest.IsolatedAsyncioTestCase): + """PdfTemplatesApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = PdfTemplatesApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_pdf_templates_get(self) -> None: + """Test case for pdf_templates_get + + Fetch PDF Templates list + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_position.py b/generated/sync/test/test_position.py new file mode 100644 index 0000000..915355b --- /dev/null +++ b/generated/sync/test/test_position.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.position import Position + +class TestPosition(unittest.TestCase): + """Position unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Position: + """Test Position + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Position` + """ + model = Position() + if include_optional: + return Position( + id = 56, + type = 'PRODUCT', + number = '1234', + description = 'iPhone X', + document_note = 'Test Note', + note = 'null', + unit = 'null', + export_identifier = 'null', + export_identifier_extended = easybill_generated_sync.models.position_export_identifier_extended.PositionExportIdentifierExtended( + null = 'null', + n_stb = 'null', + n_stb_ust_id = 'null', + n_stb_none_ust_id = 'null', + n_stb_im = 'null', + revc = 'null', + ig = 'null', + al = 'null', + s_stfr = 'null', + small_business = 'null', ), + login_id = 56, + price_type = 'NETTO', + vat_percent = 19.0, + sale_price = 1250.0, + sale_price2 = 1.337, + sale_price3 = 1.337, + sale_price4 = 1.337, + sale_price5 = 1.337, + sale_price6 = 1.337, + sale_price7 = 1.337, + sale_price8 = 1.337, + sale_price9 = 1.337, + sale_price10 = 1.337, + cost_price = 830.0, + export_cost1 = 'null', + export_cost2 = 'null', + group_id = 56, + stock = 'NO', + stock_count = 100, + stock_limit_notify = True, + stock_limit_notify_frequency = 'ALWAYS', + stock_limit = 50, + quantity = 10.0, + archived = False + ) + else: + return Position( + number = '1234', + description = 'iPhone X', + sale_price = 1250.0, + ) + """ + + def testPosition(self): + """Test Position""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_position_api.py b/generated/sync/test/test_position_api.py new file mode 100644 index 0000000..22034c7 --- /dev/null +++ b/generated/sync/test/test_position_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.position_api import PositionApi + + +class TestPositionApi(unittest.IsolatedAsyncioTestCase): + """PositionApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = PositionApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_positions_get(self) -> None: + """Test case for positions_get + + Fetch positions list + """ + pass + + async def test_positions_id_delete(self) -> None: + """Test case for positions_id_delete + + Delete position + """ + pass + + async def test_positions_id_get(self) -> None: + """Test case for positions_id_get + + Fetch position + """ + pass + + async def test_positions_id_put(self) -> None: + """Test case for positions_id_put + + Update position + """ + pass + + async def test_positions_post(self) -> None: + """Test case for positions_post + + Create position + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_position_export_identifier_extended.py b/generated/sync/test/test_position_export_identifier_extended.py new file mode 100644 index 0000000..28b635b --- /dev/null +++ b/generated/sync/test/test_position_export_identifier_extended.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.position_export_identifier_extended import PositionExportIdentifierExtended + +class TestPositionExportIdentifierExtended(unittest.TestCase): + """PositionExportIdentifierExtended unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PositionExportIdentifierExtended: + """Test PositionExportIdentifierExtended + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PositionExportIdentifierExtended` + """ + model = PositionExportIdentifierExtended() + if include_optional: + return PositionExportIdentifierExtended( + null = 'null', + n_stb = 'null', + n_stb_ust_id = 'null', + n_stb_none_ust_id = 'null', + n_stb_im = 'null', + revc = 'null', + ig = 'null', + al = 'null', + s_stfr = 'null', + small_business = 'null' + ) + else: + return PositionExportIdentifierExtended( + ) + """ + + def testPositionExportIdentifierExtended(self): + """Test PositionExportIdentifierExtended""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_position_group.py b/generated/sync/test/test_position_group.py new file mode 100644 index 0000000..6d5d9af --- /dev/null +++ b/generated/sync/test/test_position_group.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.position_group import PositionGroup + +class TestPositionGroup(unittest.TestCase): + """PositionGroup unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PositionGroup: + """Test PositionGroup + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PositionGroup` + """ + model = PositionGroup() + if include_optional: + return PositionGroup( + description = 'null', + login_id = 56, + name = 'Mobile Phones', + number = '001', + display_name = '001 - Mobile Phones', + id = 56 + ) + else: + return PositionGroup( + name = 'Mobile Phones', + number = '001', + ) + """ + + def testPositionGroup(self): + """Test PositionGroup""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_position_group_api.py b/generated/sync/test/test_position_group_api.py new file mode 100644 index 0000000..11f69af --- /dev/null +++ b/generated/sync/test/test_position_group_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.position_group_api import PositionGroupApi + + +class TestPositionGroupApi(unittest.IsolatedAsyncioTestCase): + """PositionGroupApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = PositionGroupApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_position_groups_get(self) -> None: + """Test case for position_groups_get + + Fetch position group list + """ + pass + + async def test_position_groups_id_delete(self) -> None: + """Test case for position_groups_id_delete + + Delete position group + """ + pass + + async def test_position_groups_id_get(self) -> None: + """Test case for position_groups_id_get + + Fetch position group + """ + pass + + async def test_position_groups_id_put(self) -> None: + """Test case for position_groups_id_put + + Update position group + """ + pass + + async def test_position_groups_post(self) -> None: + """Test case for position_groups_post + + Create position group + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_position_groups.py b/generated/sync/test/test_position_groups.py new file mode 100644 index 0000000..21c58d6 --- /dev/null +++ b/generated/sync/test/test_position_groups.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.position_groups import PositionGroups + +class TestPositionGroups(unittest.TestCase): + """PositionGroups unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PositionGroups: + """Test PositionGroups + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PositionGroups` + """ + model = PositionGroups() + if include_optional: + return PositionGroups( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.position_group.PositionGroup( + description = 'null', + login_id = 56, + name = 'Mobile Phones', + number = '001', + display_name = '001 - Mobile Phones', + id = 56, ) + ] + ) + else: + return PositionGroups( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testPositionGroups(self): + """Test PositionGroups""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_positions.py b/generated/sync/test/test_positions.py new file mode 100644 index 0000000..bf6aeb6 --- /dev/null +++ b/generated/sync/test/test_positions.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.positions import Positions + +class TestPositions(unittest.TestCase): + """Positions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Positions: + """Test Positions + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Positions` + """ + model = Positions() + if include_optional: + return Positions( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.position.Position( + id = 56, + type = 'PRODUCT', + number = '1234', + description = 'iPhone X', + document_note = 'Test Note', + note = 'null', + unit = 'null', + export_identifier = 'null', + export_identifier_extended = easybill_generated_sync.models.position_export_identifier_extended.PositionExportIdentifierExtended( + null = 'null', + n_stb = 'null', + n_stb_ust_id = 'null', + n_stb_none_ust_id = 'null', + n_stb_im = 'null', + revc = 'null', + ig = 'null', + al = 'null', + s_stfr = 'null', + small_business = 'null', ), + login_id = 56, + price_type = 'NETTO', + vat_percent = 19.0, + sale_price = 1250.0, + sale_price2 = 1.337, + sale_price3 = 1.337, + sale_price4 = 1.337, + sale_price5 = 1.337, + sale_price6 = 1.337, + sale_price7 = 1.337, + sale_price8 = 1.337, + sale_price9 = 1.337, + sale_price10 = 1.337, + cost_price = 830.0, + export_cost1 = 'null', + export_cost2 = 'null', + group_id = 56, + stock = 'NO', + stock_count = 100, + stock_limit_notify = True, + stock_limit_notify_frequency = 'ALWAYS', + stock_limit = 50, + quantity = 10.0, + archived = False, ) + ] + ) + else: + return Positions( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testPositions(self): + """Test Positions""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_post_box.py b/generated/sync/test/test_post_box.py new file mode 100644 index 0000000..7429822 --- /dev/null +++ b/generated/sync/test/test_post_box.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.post_box import PostBox + +class TestPostBox(unittest.TestCase): + """PostBox unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PostBox: + """Test PostBox + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PostBox` + """ + model = PostBox() + if include_optional: + return PostBox( + id = 56, + document_id = 56, + to = 'example@easybill.de', + cc = 'null', + var_from = 'example@easybill.de', + subject = 'Invoice', + message = 'Dear Mr. ...', + var_date = 'Thu Feb 07 00:00:00 UTC 2019', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + processed_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + send_by_self = False, + send_with_attachment = True, + type = 'EMAIL', + status = 'WAITING', + status_msg = 'null', + login_id = 56, + document_file_type = 'default', + post_send_type = 'post_send_type_standard', + tracking_identifier = 'DE1234567890' + ) + else: + return PostBox( + ) + """ + + def testPostBox(self): + """Test PostBox""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_post_box_api.py b/generated/sync/test/test_post_box_api.py new file mode 100644 index 0000000..9c09e19 --- /dev/null +++ b/generated/sync/test/test_post_box_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.post_box_api import PostBoxApi + + +class TestPostBoxApi(unittest.IsolatedAsyncioTestCase): + """PostBoxApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = PostBoxApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_post_boxes_get(self) -> None: + """Test case for post_boxes_get + + Fetch post box list + """ + pass + + async def test_post_boxes_id_delete(self) -> None: + """Test case for post_boxes_id_delete + + Delete post box + """ + pass + + async def test_post_boxes_id_get(self) -> None: + """Test case for post_boxes_id_get + + Fetch post box + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_post_box_request.py b/generated/sync/test/test_post_box_request.py new file mode 100644 index 0000000..7e9a033 --- /dev/null +++ b/generated/sync/test/test_post_box_request.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.post_box_request import PostBoxRequest + +class TestPostBoxRequest(unittest.TestCase): + """PostBoxRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PostBoxRequest: + """Test PostBoxRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PostBoxRequest` + """ + model = PostBoxRequest() + if include_optional: + return PostBoxRequest( + to = '', + cc = '', + var_from = '', + subject = '', + message = '', + var_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + send_by_self = False, + send_with_attachment = True, + document_file_type = 'default', + post_send_type = 'post_send_type_standard' + ) + else: + return PostBoxRequest( + ) + """ + + def testPostBoxRequest(self): + """Test PostBoxRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_post_boxes.py b/generated/sync/test/test_post_boxes.py new file mode 100644 index 0000000..fc1afa1 --- /dev/null +++ b/generated/sync/test/test_post_boxes.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.post_boxes import PostBoxes + +class TestPostBoxes(unittest.TestCase): + """PostBoxes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PostBoxes: + """Test PostBoxes + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `PostBoxes` + """ + model = PostBoxes() + if include_optional: + return PostBoxes( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.post_box.PostBox( + id = 56, + document_id = 56, + to = 'example@easybill.de', + cc = 'null', + from = 'example@easybill.de', + subject = 'Invoice', + message = 'Dear Mr. ...', + date = 'Thu Feb 07 00:00:00 UTC 2019', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + processed_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + send_by_self = False, + send_with_attachment = True, + type = 'EMAIL', + status = 'WAITING', + status_msg = 'null', + login_id = 56, + document_file_type = 'default', + post_send_type = 'post_send_type_standard', + tracking_identifier = 'DE1234567890', ) + ] + ) + else: + return PostBoxes( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testPostBoxes(self): + """Test PostBoxes""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_project.py b/generated/sync/test/test_project.py new file mode 100644 index 0000000..ea2f3a5 --- /dev/null +++ b/generated/sync/test/test_project.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.project import Project + +class TestProject(unittest.TestCase): + """Project unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Project: + """Test Project + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Project` + """ + model = Project() + if include_optional: + return Project( + budget_amount = 10000, + budget_time = 60, + customer_id = 56, + hourly_rate = 3000.0, + id = 56, + login_id = 56, + name = 'My Project', + note = 'null', + status = 'OPEN', + due_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + budget_notify_frequency = 'ALWAYS', + consumed_time = 56, + consumed_amount = 56 + ) + else: + return Project( + name = 'My Project', + ) + """ + + def testProject(self): + """Test Project""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_project_api.py b/generated/sync/test/test_project_api.py new file mode 100644 index 0000000..6fc4373 --- /dev/null +++ b/generated/sync/test/test_project_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.project_api import ProjectApi + + +class TestProjectApi(unittest.IsolatedAsyncioTestCase): + """ProjectApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = ProjectApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_projects_get(self) -> None: + """Test case for projects_get + + Fetch projects list + """ + pass + + async def test_projects_id_delete(self) -> None: + """Test case for projects_id_delete + + Delete project + """ + pass + + async def test_projects_id_get(self) -> None: + """Test case for projects_id_get + + Fetch project + """ + pass + + async def test_projects_id_put(self) -> None: + """Test case for projects_id_put + + Update project + """ + pass + + async def test_projects_post(self) -> None: + """Test case for projects_post + + Create project + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_projects.py b/generated/sync/test/test_projects.py new file mode 100644 index 0000000..65468d5 --- /dev/null +++ b/generated/sync/test/test_projects.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.projects import Projects + +class TestProjects(unittest.TestCase): + """Projects unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Projects: + """Test Projects + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Projects` + """ + model = Projects() + if include_optional: + return Projects( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.project.Project( + budget_amount = 10000, + budget_time = 60, + customer_id = 56, + hourly_rate = 3000.0, + id = 56, + login_id = 56, + name = 'My Project', + note = 'null', + status = 'OPEN', + due_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + budget_notify_frequency = 'ALWAYS', + consumed_time = 56, + consumed_amount = 56, ) + ] + ) + else: + return Projects( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testProjects(self): + """Test Projects""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_sepa_payment.py b/generated/sync/test/test_sepa_payment.py new file mode 100644 index 0000000..130a42c --- /dev/null +++ b/generated/sync/test/test_sepa_payment.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.sepa_payment import SEPAPayment + +class TestSEPAPayment(unittest.TestCase): + """SEPAPayment unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SEPAPayment: + """Test SEPAPayment + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SEPAPayment` + """ + model = SEPAPayment() + if include_optional: + return SEPAPayment( + amount = 10000, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + creditor_bic = 'null', + creditor_iban = 'DE12345678901234567890', + creditor_name = 'Easybill GmbH', + debitor_bic = 'null', + debitor_iban = 'DE12345678901234567890', + debitor_name = 'Easybill GmbH', + debitor_address_line_1 = 'Bahnhofstr. 1', + debitor_address_line2 = '8001 Zürich', + debitor_country = 'CH', + document_id = 56, + export_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + export_error = 'null', + id = 56, + local_instrument = 'CORE', + mandate_date_of_signature = 'Fri Feb 01 00:00:00 UTC 2019', + mandate_id = '001', + reference = 'X000000001', + remittance_information = 'null', + requested_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + sequence_type = 'FRST', + updated_at = '2018-01-01 23:23:45', + type = 'DEBIT' + ) + else: + return SEPAPayment( + amount = 10000, + debitor_iban = 'DE12345678901234567890', + debitor_name = 'Easybill GmbH', + document_id = 56, + local_instrument = 'CORE', + mandate_date_of_signature = 'Fri Feb 01 00:00:00 UTC 2019', + mandate_id = '001', + reference = 'X000000001', + sequence_type = 'FRST', + ) + """ + + def testSEPAPayment(self): + """Test SEPAPayment""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_sepa_payment_api.py b/generated/sync/test/test_sepa_payment_api.py new file mode 100644 index 0000000..44eff65 --- /dev/null +++ b/generated/sync/test/test_sepa_payment_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.sepa_payment_api import SepaPaymentApi + + +class TestSepaPaymentApi(unittest.IsolatedAsyncioTestCase): + """SepaPaymentApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = SepaPaymentApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_sepa_payments_get(self) -> None: + """Test case for sepa_payments_get + + Fetch SEPA payments list + """ + pass + + async def test_sepa_payments_id_delete(self) -> None: + """Test case for sepa_payments_id_delete + + Delete SEPA payment + """ + pass + + async def test_sepa_payments_id_get(self) -> None: + """Test case for sepa_payments_id_get + + Fetch SEPA payment + """ + pass + + async def test_sepa_payments_id_put(self) -> None: + """Test case for sepa_payments_id_put + + Update SEPA payment + """ + pass + + async def test_sepa_payments_post(self) -> None: + """Test case for sepa_payments_post + + Create SEPA payment + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_sepa_payments.py b/generated/sync/test/test_sepa_payments.py new file mode 100644 index 0000000..6cc42e5 --- /dev/null +++ b/generated/sync/test/test_sepa_payments.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.sepa_payments import SEPAPayments + +class TestSEPAPayments(unittest.TestCase): + """SEPAPayments unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SEPAPayments: + """Test SEPAPayments + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SEPAPayments` + """ + model = SEPAPayments() + if include_optional: + return SEPAPayments( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.sepa_payment.SEPAPayment( + amount = 10000, + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + creditor_bic = 'null', + creditor_iban = 'DE12345678901234567890', + creditor_name = 'Easybill GmbH', + debitor_bic = 'null', + debitor_iban = 'DE12345678901234567890', + debitor_name = 'Easybill GmbH', + debitor_address_line_1 = 'Bahnhofstr. 1', + debitor_address_line2 = '8001 Zürich', + debitor_country = 'CH', + document_id = 56, + export_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + export_error = 'null', + id = 56, + local_instrument = 'CORE', + mandate_date_of_signature = 'Fri Feb 01 00:00:00 UTC 2019', + mandate_id = '001', + reference = 'X000000001', + remittance_information = 'null', + requested_at = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + sequence_type = 'FRST', + updated_at = '2018-01-01 23:23:45', + type = 'DEBIT', ) + ] + ) + else: + return SEPAPayments( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testSEPAPayments(self): + """Test SEPAPayments""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_serial_number.py b/generated/sync/test/test_serial_number.py new file mode 100644 index 0000000..ae6ce95 --- /dev/null +++ b/generated/sync/test/test_serial_number.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.serial_number import SerialNumber + +class TestSerialNumber(unittest.TestCase): + """SerialNumber unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SerialNumber: + """Test SerialNumber + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SerialNumber` + """ + model = SerialNumber() + if include_optional: + return SerialNumber( + id = 56, + serial_number = 'DHEZ-DHSNR-2344D-FFW', + position_id = 56, + document_id = 56, + document_position_id = 56, + used_at = 'null', + created_at = '2018-01-01 23:23:45' + ) + else: + return SerialNumber( + serial_number = 'DHEZ-DHSNR-2344D-FFW', + position_id = 56, + ) + """ + + def testSerialNumber(self): + """Test SerialNumber""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_serial_number_api.py b/generated/sync/test/test_serial_number_api.py new file mode 100644 index 0000000..8d32c6f --- /dev/null +++ b/generated/sync/test/test_serial_number_api.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.serial_number_api import SerialNumberApi + + +class TestSerialNumberApi(unittest.IsolatedAsyncioTestCase): + """SerialNumberApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = SerialNumberApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_serial_numbers_get(self) -> None: + """Test case for serial_numbers_get + + Fetch a list of serial numbers for positions + """ + pass + + async def test_serial_numbers_id_delete(self) -> None: + """Test case for serial_numbers_id_delete + + Delete a serial number for a position + """ + pass + + async def test_serial_numbers_id_get(self) -> None: + """Test case for serial_numbers_id_get + + Fetch a serial number for a position + """ + pass + + async def test_serial_numbers_post(self) -> None: + """Test case for serial_numbers_post + + Create s serial number for a position + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_serial_numbers.py b/generated/sync/test/test_serial_numbers.py new file mode 100644 index 0000000..9c3eef0 --- /dev/null +++ b/generated/sync/test/test_serial_numbers.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.serial_numbers import SerialNumbers + +class TestSerialNumbers(unittest.TestCase): + """SerialNumbers unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SerialNumbers: + """Test SerialNumbers + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SerialNumbers` + """ + model = SerialNumbers() + if include_optional: + return SerialNumbers( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.serial_number.SerialNumber( + id = 56, + serial_number = 'DHEZ-DHSNR-2344D-FFW', + position_id = 56, + document_id = 56, + document_position_id = 56, + used_at = 'null', + created_at = '2018-01-01 23:23:45', ) + ] + ) + else: + return SerialNumbers( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testSerialNumbers(self): + """Test SerialNumbers""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_service_date.py b/generated/sync/test/test_service_date.py new file mode 100644 index 0000000..7842b2c --- /dev/null +++ b/generated/sync/test/test_service_date.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.service_date import ServiceDate + +class TestServiceDate(unittest.TestCase): + """ServiceDate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ServiceDate: + """Test ServiceDate + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ServiceDate` + """ + model = ServiceDate() + if include_optional: + return ServiceDate( + type = 'DEFAULT', + var_date = 'Fri Feb 01 00:00:00 UTC 2019', + date_from = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + date_to = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + text = 'null' + ) + else: + return ServiceDate( + ) + """ + + def testServiceDate(self): + """Test ServiceDate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_stock.py b/generated/sync/test/test_stock.py new file mode 100644 index 0000000..c943cdc --- /dev/null +++ b/generated/sync/test/test_stock.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.stock import Stock + +class TestStock(unittest.TestCase): + """Stock unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Stock: + """Test Stock + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Stock` + """ + model = Stock() + if include_optional: + return Stock( + id = 56, + note = 'Correction for stock count of the Entry from 11/01/2017', + stock_count = 666, + position_id = 56, + document_id = 56, + document_position_id = 56, + stored_at = '2017-04-11 13:00:00', + created_at = '2018-01-01 23:23:45', + updated_at = '2018-01-01 23:23:45' + ) + else: + return Stock( + stock_count = 666, + position_id = 56, + ) + """ + + def testStock(self): + """Test Stock""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_stock_api.py b/generated/sync/test/test_stock_api.py new file mode 100644 index 0000000..5301fc7 --- /dev/null +++ b/generated/sync/test/test_stock_api.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.stock_api import StockApi + + +class TestStockApi(unittest.IsolatedAsyncioTestCase): + """StockApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = StockApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_stocks_get(self) -> None: + """Test case for stocks_get + + Fetch a list of stock entries for positions + """ + pass + + async def test_stocks_id_get(self) -> None: + """Test case for stocks_id_get + + Fetch an stock entry for a position + """ + pass + + async def test_stocks_post(self) -> None: + """Test case for stocks_post + + Create a stock entry for a position + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_stocks.py b/generated/sync/test/test_stocks.py new file mode 100644 index 0000000..b3b2d23 --- /dev/null +++ b/generated/sync/test/test_stocks.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.stocks import Stocks + +class TestStocks(unittest.TestCase): + """Stocks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Stocks: + """Test Stocks + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Stocks` + """ + model = Stocks() + if include_optional: + return Stocks( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.stock.Stock( + id = 56, + note = 'Correction for stock count of the Entry from 11/01/2017', + stock_count = 666, + position_id = 56, + document_id = 56, + document_position_id = 56, + stored_at = '2017-04-11 13:00:00', + created_at = '2018-01-01 23:23:45', + updated_at = '2018-01-01 23:23:45', ) + ] + ) + else: + return Stocks( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testStocks(self): + """Test Stocks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_task.py b/generated/sync/test/test_task.py new file mode 100644 index 0000000..a6ab685 --- /dev/null +++ b/generated/sync/test/test_task.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.task import Task + +class TestTask(unittest.TestCase): + """Task unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Task: + """Test Task + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Task` + """ + model = Task() + if include_optional: + return Task( + category = 'CALL', + category_custom = 'null', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_id = 56, + description = 'null', + document_id = 56, + end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + finish_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + id = 56, + login_id = 56, + name = 'Call client', + position_id = 56, + priority = 'NORMAL', + project_id = 56, + start_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + status = 'PROCESSING', + status_percent = 50 + ) + else: + return Task( + name = 'Call client', + status = 'PROCESSING', + ) + """ + + def testTask(self): + """Test Task""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_task_api.py b/generated/sync/test/test_task_api.py new file mode 100644 index 0000000..0528733 --- /dev/null +++ b/generated/sync/test/test_task_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.task_api import TaskApi + + +class TestTaskApi(unittest.IsolatedAsyncioTestCase): + """TaskApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = TaskApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_tasks_get(self) -> None: + """Test case for tasks_get + + Fetch tasks list + """ + pass + + async def test_tasks_id_delete(self) -> None: + """Test case for tasks_id_delete + + Delete task + """ + pass + + async def test_tasks_id_get(self) -> None: + """Test case for tasks_id_get + + Fetch task + """ + pass + + async def test_tasks_id_put(self) -> None: + """Test case for tasks_id_put + + Update task + """ + pass + + async def test_tasks_post(self) -> None: + """Test case for tasks_post + + Create task + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_tasks.py b/generated/sync/test/test_tasks.py new file mode 100644 index 0000000..79baa78 --- /dev/null +++ b/generated/sync/test/test_tasks.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.tasks import Tasks + +class TestTasks(unittest.TestCase): + """Tasks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Tasks: + """Test Tasks + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Tasks` + """ + model = Tasks() + if include_optional: + return Tasks( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.task.Task( + category = 'CALL', + category_custom = 'null', + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + customer_id = 56, + description = 'null', + document_id = 56, + end_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + finish_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + id = 56, + login_id = 56, + name = 'Call client', + position_id = 56, + priority = 'NORMAL', + project_id = 56, + start_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + status = 'PROCESSING', + status_percent = 50, ) + ] + ) + else: + return Tasks( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testTasks(self): + """Test Tasks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_text_template.py b/generated/sync/test/test_text_template.py new file mode 100644 index 0000000..8ce1477 --- /dev/null +++ b/generated/sync/test/test_text_template.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.text_template import TextTemplate + +class TestTextTemplate(unittest.TestCase): + """TextTemplate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TextTemplate: + """Test TextTemplate + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TextTemplate` + """ + model = TextTemplate() + if include_optional: + return TextTemplate( + can_modify = True, + id = 56, + text = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.', + title = 'Lorem Ipsum' + ) + else: + return TextTemplate( + text = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.', + title = 'Lorem Ipsum', + ) + """ + + def testTextTemplate(self): + """Test TextTemplate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_text_template_api.py b/generated/sync/test/test_text_template_api.py new file mode 100644 index 0000000..952f305 --- /dev/null +++ b/generated/sync/test/test_text_template_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.text_template_api import TextTemplateApi + + +class TestTextTemplateApi(unittest.IsolatedAsyncioTestCase): + """TextTemplateApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = TextTemplateApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_text_templates_get(self) -> None: + """Test case for text_templates_get + + Fetch text templates list + """ + pass + + async def test_text_templates_id_delete(self) -> None: + """Test case for text_templates_id_delete + + Delete text template + """ + pass + + async def test_text_templates_id_get(self) -> None: + """Test case for text_templates_id_get + + Fetch text template + """ + pass + + async def test_text_templates_id_put(self) -> None: + """Test case for text_templates_id_put + + Update text template + """ + pass + + async def test_text_templates_post(self) -> None: + """Test case for text_templates_post + + Create text template + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_text_templates.py b/generated/sync/test/test_text_templates.py new file mode 100644 index 0000000..51a4a33 --- /dev/null +++ b/generated/sync/test/test_text_templates.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.text_templates import TextTemplates + +class TestTextTemplates(unittest.TestCase): + """TextTemplates unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TextTemplates: + """Test TextTemplates + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TextTemplates` + """ + model = TextTemplates() + if include_optional: + return TextTemplates( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.text_template.TextTemplate( + can_modify = True, + id = 56, + text = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.', + title = 'Lorem Ipsum', ) + ] + ) + else: + return TextTemplates( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testTextTemplates(self): + """Test TextTemplates""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_time_tracking.py b/generated/sync/test/test_time_tracking.py new file mode 100644 index 0000000..92257fc --- /dev/null +++ b/generated/sync/test/test_time_tracking.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.time_tracking import TimeTracking + +class TestTimeTracking(unittest.TestCase): + """TimeTracking unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TimeTracking: + """Test TimeTracking + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TimeTracking` + """ + model = TimeTracking() + if include_optional: + return TimeTracking( + cleared_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + date_from_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + date_thru_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = 'Meeting with client', + hourly_rate = 2000.0, + id = 56, + note = 'null', + number = '001', + position_id = 56, + project_id = 56, + login_id = 56, + timer_value = 90 + ) + else: + return TimeTracking( + description = 'Meeting with client', + ) + """ + + def testTimeTracking(self): + """Test TimeTracking""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_time_tracking_api.py b/generated/sync/test/test_time_tracking_api.py new file mode 100644 index 0000000..1524913 --- /dev/null +++ b/generated/sync/test/test_time_tracking_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.time_tracking_api import TimeTrackingApi + + +class TestTimeTrackingApi(unittest.IsolatedAsyncioTestCase): + """TimeTrackingApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = TimeTrackingApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_time_trackings_get(self) -> None: + """Test case for time_trackings_get + + Fetch time trackings list + """ + pass + + async def test_time_trackings_id_delete(self) -> None: + """Test case for time_trackings_id_delete + + Delete time tracking + """ + pass + + async def test_time_trackings_id_get(self) -> None: + """Test case for time_trackings_id_get + + Fetch time tracking + """ + pass + + async def test_time_trackings_id_put(self) -> None: + """Test case for time_trackings_id_put + + Update time tracking + """ + pass + + async def test_time_trackings_post(self) -> None: + """Test case for time_trackings_post + + Create time tracking + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_time_trackings.py b/generated/sync/test/test_time_trackings.py new file mode 100644 index 0000000..c07aa1c --- /dev/null +++ b/generated/sync/test/test_time_trackings.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.time_trackings import TimeTrackings + +class TestTimeTrackings(unittest.TestCase): + """TimeTrackings unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TimeTrackings: + """Test TimeTrackings + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TimeTrackings` + """ + model = TimeTrackings() + if include_optional: + return TimeTrackings( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.time_tracking.TimeTracking( + cleared_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + date_from_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + date_thru_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + description = 'Meeting with client', + hourly_rate = 2000.0, + id = 56, + note = 'null', + number = '001', + position_id = 56, + project_id = 56, + login_id = 56, + timer_value = 90, ) + ] + ) + else: + return TimeTrackings( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testTimeTrackings(self): + """Test TimeTrackings""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_web_hook.py b/generated/sync/test/test_web_hook.py new file mode 100644 index 0000000..80dcb44 --- /dev/null +++ b/generated/sync/test/test_web_hook.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.web_hook import WebHook + +class TestWebHook(unittest.TestCase): + """WebHook unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebHook: + """Test WebHook + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebHook` + """ + model = WebHook() + if include_optional: + return WebHook( + content_type = 'form', + description = 'My Webhook', + events = [ + 'document.create' + ], + id = 56, + is_active = True, + last_response = easybill_generated_sync.models.web_hook_last_response.WebHookLastResponse( + date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + code = 204, + response = '', ), + secret = '', + url = 'https://...' + ) + else: + return WebHook( + content_type = 'form', + description = 'My Webhook', + events = [ + 'document.create' + ], + secret = '', + url = 'https://...', + ) + """ + + def testWebHook(self): + """Test WebHook""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_web_hook_last_response.py b/generated/sync/test/test_web_hook_last_response.py new file mode 100644 index 0000000..2b23405 --- /dev/null +++ b/generated/sync/test/test_web_hook_last_response.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.web_hook_last_response import WebHookLastResponse + +class TestWebHookLastResponse(unittest.TestCase): + """WebHookLastResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebHookLastResponse: + """Test WebHookLastResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebHookLastResponse` + """ + model = WebHookLastResponse() + if include_optional: + return WebHookLastResponse( + var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + code = 204, + response = '' + ) + else: + return WebHookLastResponse( + ) + """ + + def testWebHookLastResponse(self): + """Test WebHookLastResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_web_hooks.py b/generated/sync/test/test_web_hooks.py new file mode 100644 index 0000000..99c8ee0 --- /dev/null +++ b/generated/sync/test/test_web_hooks.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.models.web_hooks import WebHooks + +class TestWebHooks(unittest.TestCase): + """WebHooks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebHooks: + """Test WebHooks + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebHooks` + """ + model = WebHooks() + if include_optional: + return WebHooks( + page = 1, + pages = 1, + limit = 100, + total = 20, + items = [ + easybill_generated_sync.models.web_hook.WebHook( + content_type = 'form', + description = 'My Webhook', + events = [ + 'document.create' + ], + id = 56, + is_active = True, + last_response = easybill_generated_sync.models.web_hook_last_response.WebHookLastResponse( + date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + code = 204, + response = '', ), + secret = '', + url = 'https://...', ) + ] + ) + else: + return WebHooks( + page = 1, + pages = 1, + limit = 100, + total = 20, + ) + """ + + def testWebHooks(self): + """Test WebHooks""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/test/test_webhook_api.py b/generated/sync/test/test_webhook_api.py new file mode 100644 index 0000000..3b392a8 --- /dev/null +++ b/generated/sync/test/test_webhook_api.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + easybill REST API + + The first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md) ## Authentication You can choose between two available methods: `Basic Auth` or `Bearer Token`. In each HTTP request, one of the following HTTP headers is required: ``` # Basic Auth Authorization: Basic base64_encode(':') # Bearer Token Authorization: Bearer ``` ## Limitations ### Request Limit * PLUS: 10 requests per minute * BUSINESS: 60 requests per minute If the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests` ### Result Limit All result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000. ## Query filter Many list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`. **Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large` ### Escape commas in query You can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request. ## Property login_id This is the login of your admin or employee account. ## Date and Date-Time format Please use the timezone `Europe/Berlin`. * **date** = *Y-m-d* = `2016-12-31` * **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37` Date or datetime can be `null` because the attributes have been added later and the entry is older. + + The version of the OpenAPI document: 1.96.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from easybill_generated_sync.api.webhook_api import WebhookApi + + +class TestWebhookApi(unittest.IsolatedAsyncioTestCase): + """WebhookApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = WebhookApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_webhooks_get(self) -> None: + """Test case for webhooks_get + + Fetch WebHooks list + """ + pass + + async def test_webhooks_id_delete(self) -> None: + """Test case for webhooks_id_delete + + Delete WebHook + """ + pass + + async def test_webhooks_id_get(self) -> None: + """Test case for webhooks_id_get + + Fetch WebHook + """ + pass + + async def test_webhooks_id_put(self) -> None: + """Test case for webhooks_id_put + + Update WebHook + """ + pass + + async def test_webhooks_post(self) -> None: + """Test case for webhooks_post + + Create WebHook + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/generated/sync/tox.ini b/generated/sync/tox.ini new file mode 100644 index 0000000..c093a98 --- /dev/null +++ b/generated/sync/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=easybill_generated_sync diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7bafca0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,30 @@ +[build-system] +requires = ["hatchling>=1.27.0"] +build-backend = "hatchling.build" + +[project] +name = "easybill-client" +version = "0.1.0" +description = "Python easybill REST API client with Pydantic models and webhook helpers" +readme = "README.md" +requires-python = ">=3.11" +authors = [ + { name = "GitHub Copilot" } +] +dependencies = [ + "httpx>=0.27,<1", + "pydantic>=2.8,<3", +] + +[project.optional-dependencies] +dev = [ + "pytest>=8.3,<9", + "pytest-asyncio>=0.24,<1", +] + +[tool.pytest.ini_options] +testpaths = ["tests"] +pythonpath = ["src"] + +[tool.hatch.build.targets.wheel] +packages = ["src/easybill_client"] diff --git a/scripts/generate_client.py b/scripts/generate_client.py new file mode 100644 index 0000000..1e87efa --- /dev/null +++ b/scripts/generate_client.py @@ -0,0 +1,59 @@ +from __future__ import annotations + +import argparse +import subprocess +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[1] +SPEC = ROOT / "swagger.json" +OUTPUT_ROOT = ROOT / "generated" + + +def build_command(mode: str) -> list[str]: + library = "httpx" if mode == "sync" else "asyncio" + package_name = f"easybill_generated_{mode}" + project_name = f"easybill-generated-{mode}" + output_path = OUTPUT_ROOT / mode + + return [ + "docker", + "run", + "--rm", + "-v", + f"{ROOT}:/local", + "openapitools/openapi-generator-cli", + "generate", + "-i", + "/local/swagger.json", + "-g", + "python", + "-o", + f"/local/generated/{mode}", + "--skip-validate-spec", + "--additional-properties", + f"library={library},packageName={package_name},projectName={project_name},hideGenerationTimestamp=true", + ] + + +def main() -> int: + parser = argparse.ArgumentParser(description="Generate the raw easybill client from swagger.json") + parser.add_argument("--mode", choices=["sync", "async", "both"], default="both") + args = parser.parse_args() + + if not SPEC.exists(): + raise SystemExit("swagger.json not found") + + OUTPUT_ROOT.mkdir(exist_ok=True) + modes = ["sync", "async"] if args.mode == "both" else [args.mode] + + for mode in modes: + command = build_command(mode) + print("Running:", " ".join(command)) + subprocess.run(command, check=True) + + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/src/easybill_client/__init__.py b/src/easybill_client/__init__.py new file mode 100644 index 0000000..a89dc42 --- /dev/null +++ b/src/easybill_client/__init__.py @@ -0,0 +1,15 @@ +from .auth import EasybillAuth, basic_auth_header, bearer_auth_header +from .client import AsyncEasybillClient, EasybillClient +from .models import Pagination, WebhookEnvelope +from .webhooks import EasybillWebhookParser + +__all__ = [ + "AsyncEasybillClient", + "EasybillAuth", + "EasybillClient", + "EasybillWebhookParser", + "Pagination", + "WebhookEnvelope", + "basic_auth_header", + "bearer_auth_header", +] diff --git a/src/easybill_client/auth.py b/src/easybill_client/auth.py new file mode 100644 index 0000000..9e733b0 --- /dev/null +++ b/src/easybill_client/auth.py @@ -0,0 +1,40 @@ +from __future__ import annotations + +import base64 +from typing import Any + +import httpx + + +def bearer_auth_header(api_key: str) -> dict[str, str]: + if not api_key: + raise ValueError("api_key is required for bearer authentication") + return {"Authorization": f"Bearer {api_key}"} + + +def basic_auth_header(email: str, api_key: str) -> dict[str, str]: + if not email: + raise ValueError("email is required for basic authentication") + if not api_key: + raise ValueError("api_key is required for basic authentication") + + token = base64.b64encode(f"{email}:{api_key}".encode("utf-8")).decode("ascii") + return {"Authorization": f"Basic {token}"} + + +class EasybillAuth(httpx.Auth): + def __init__(self, api_key: str, *, email: str | None = None, use_basic_auth: bool = False) -> None: + self.api_key = api_key + self.email = email + self.use_basic_auth = use_basic_auth + + def build_headers(self) -> dict[str, str]: + if self.use_basic_auth: + if not self.email: + raise ValueError("email must be provided when use_basic_auth is enabled") + return basic_auth_header(self.email, self.api_key) + return bearer_auth_header(self.api_key) + + def auth_flow(self, request: httpx.Request) -> Any: + request.headers.update(self.build_headers()) + yield request diff --git a/src/easybill_client/client.py b/src/easybill_client/client.py new file mode 100644 index 0000000..97378b8 --- /dev/null +++ b/src/easybill_client/client.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +from typing import Any + +import httpx + +from .auth import EasybillAuth + + +class EasybillAPIError(RuntimeError): + def __init__(self, status_code: int, message: str, *, response_text: str = "") -> None: + super().__init__(f"easybill API error {status_code}: {message}") + self.status_code = status_code + self.response_text = response_text + + +class _BaseEasybillClient: + def __init__( + self, + api_key: str, + *, + email: str | None = None, + use_basic_auth: bool = False, + base_url: str = "https://api.easybill.de/rest/v1", + timeout: float = 30.0, + default_limit: int = 100, + ) -> None: + self.base_url = base_url.rstrip("/") + self.timeout = timeout + self.default_limit = default_limit + self.auth = EasybillAuth(api_key, email=email, use_basic_auth=use_basic_auth) + self.default_headers = { + "Accept": "application/json", + "Content-Type": "application/json", + } + + @staticmethod + def _check_response(response: httpx.Response) -> httpx.Response: + if response.is_error: + message = response.reason_phrase or "request failed" + raise EasybillAPIError(response.status_code, message, response_text=response.text) + return response + + +class EasybillClient(_BaseEasybillClient): + def __init__(self, api_key: str, **kwargs: Any) -> None: + super().__init__(api_key, **kwargs) + self._client = httpx.Client( + base_url=self.base_url, + timeout=self.timeout, + headers=self.default_headers, + auth=self.auth, + ) + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> "EasybillClient": + return self + + def __exit__(self, *_: Any) -> None: + self.close() + + def request(self, method: str, path: str, **kwargs: Any) -> httpx.Response: + response = self._client.request(method, path, **kwargs) + return self._check_response(response) + + def get_json(self, path: str, **kwargs: Any) -> Any: + return self.request("GET", path, **kwargs).json() + + def list_webhooks(self, *, page: int = 1, limit: int | None = None) -> Any: + params = {"page": page, "limit": limit or self.default_limit} + return self.get_json("/webhooks", params=params) + + +class AsyncEasybillClient(_BaseEasybillClient): + def __init__(self, api_key: str, **kwargs: Any) -> None: + super().__init__(api_key, **kwargs) + self._client = httpx.AsyncClient( + base_url=self.base_url, + timeout=self.timeout, + headers=self.default_headers, + auth=self.auth, + ) + + async def aclose(self) -> None: + await self._client.aclose() + + async def __aenter__(self) -> "AsyncEasybillClient": + return self + + async def __aexit__(self, *_: Any) -> None: + await self.aclose() + + async def request(self, method: str, path: str, **kwargs: Any) -> httpx.Response: + response = await self._client.request(method, path, **kwargs) + return self._check_response(response) + + async def get_json(self, path: str, **kwargs: Any) -> Any: + response = await self.request("GET", path, **kwargs) + return response.json() + + async def list_webhooks(self, *, page: int = 1, limit: int | None = None) -> Any: + params = {"page": page, "limit": limit or self.default_limit} + return await self.get_json("/webhooks", params=params) diff --git a/src/easybill_client/models.py b/src/easybill_client/models.py new file mode 100644 index 0000000..ac1303f --- /dev/null +++ b/src/easybill_client/models.py @@ -0,0 +1,24 @@ +from __future__ import annotations + +from typing import Any + +from pydantic import BaseModel, ConfigDict, Field + + +class EasybillBaseModel(BaseModel): + model_config = ConfigDict(extra="allow", populate_by_name=True) + + +class Pagination(EasybillBaseModel): + page: int = 1 + pages: int = 1 + limit: int = 100 + total: int = 0 + + +class WebhookEnvelope(EasybillBaseModel): + event: str + delivery_id: str + payload: dict[str, Any] = Field(default_factory=dict) + resource_id: int | None = None + headers: dict[str, str] = Field(default_factory=dict) diff --git a/src/easybill_client/py.typed b/src/easybill_client/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/src/easybill_client/webhooks.py b/src/easybill_client/webhooks.py new file mode 100644 index 0000000..a516765 --- /dev/null +++ b/src/easybill_client/webhooks.py @@ -0,0 +1,91 @@ +from __future__ import annotations + +from typing import Any, Mapping + +from .models import WebhookEnvelope + + +class EasybillWebhookParser: + def __init__(self, secret: str | None = None) -> None: + self.secret = secret + + def parse( + self, + *, + headers: Mapping[str, Any], + payload: Mapping[str, Any] | None, + content_type: str | None = None, + ) -> WebhookEnvelope: + normalized_content_type = (content_type or "application/json").lower() + + if "json" in normalized_content_type: + return self.parse_json(headers=headers, payload=payload) + + if "form" in normalized_content_type or "x-www-form-urlencoded" in normalized_content_type or "multipart/form-data" in normalized_content_type: + return self.parse_form(headers=headers, form_data=payload or {}) + + if isinstance(payload, Mapping): + return self.parse_json(headers=headers, payload=payload) + + raise ValueError(f"Unsupported webhook content type: {content_type}") + + def parse_json(self, *, headers: Mapping[str, Any], payload: Mapping[str, Any] | None) -> WebhookEnvelope: + normalized_payload = dict(payload or {}) + return self._build_envelope(headers, normalized_payload) + + def parse_form(self, *, headers: Mapping[str, Any], form_data: Mapping[str, Any]) -> WebhookEnvelope: + normalized_payload = { + str(key): self._coerce_scalar(value) + for key, value in form_data.items() + } + return self._build_envelope(headers, normalized_payload) + + @staticmethod + def build_acknowledgement() -> dict[str, str]: + return {"status": "ok"} + + def _build_envelope(self, headers: Mapping[str, Any], payload: dict[str, Any]) -> WebhookEnvelope: + normalized_headers = {str(key).lower(): str(value) for key, value in headers.items()} + event = self._get_required_header(normalized_headers, "x-easybill-event") + delivery_id = self._get_required_header(normalized_headers, "x-easybill-webhook-delivery") + + return WebhookEnvelope( + event=event, + delivery_id=delivery_id, + payload=payload, + resource_id=self._extract_resource_id(payload), + headers=normalized_headers, + ) + + @staticmethod + def _get_required_header(headers: Mapping[str, str], name: str) -> str: + value = headers.get(name) + if not value: + raise ValueError(f"Missing required header: {name}") + return value + + @staticmethod + def _extract_resource_id(payload: Mapping[str, Any]) -> int | None: + for key in ("id", "document_id", "customer_id", "position_id", "project_id", "task_id"): + value = payload.get(key) + if value is None: + continue + try: + return int(value) + except (TypeError, ValueError): + continue + return None + + @staticmethod + def _coerce_scalar(value: Any) -> Any: + if isinstance(value, list): + return [EasybillWebhookParser._coerce_scalar(item) for item in value] + if isinstance(value, str): + stripped = value.strip() + if stripped.isdigit(): + return int(stripped) + lowered = stripped.lower() + if lowered in {"true", "false"}: + return lowered == "true" + return stripped + return value diff --git a/swagger.json b/swagger.json new file mode 100644 index 0000000..f65f3fc --- /dev/null +++ b/swagger.json @@ -0,0 +1,7539 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.96.0", + "title": "easybill REST API", + "description": "\nThe first version of the easybill REST API. [CHANGELOG](https://api.easybill.de/rest/v1/CHANGELOG.md)\n\n## Authentication\n\nYou can choose between two available methods: `Basic Auth` or `Bearer Token`.\n\nIn each HTTP request, one of the following HTTP headers is required:\n\n```\n# Basic Auth\nAuthorization: Basic base64_encode(':')\n# Bearer Token\nAuthorization: Bearer \n```\n\n## Limitations\n\n### Request Limit\n\n* PLUS: 10 requests per minute\n* BUSINESS: 60 requests per minute\n\nIf the limit is exceeded, you will receive the HTTP error: `429 Too Many Requests`\n\n### Result Limit\n\nAll result lists are limited to 100 by default. This limit can be increased by the query parameter `limit` to a maximum of 1000.\n\n## Query filter\n\nMany list resources can be filtered. In `/documents` you can filter e.g. by number with `/documents?number=111028654`. If you want to filter multiple numbers, you can either enter them separated by commas `/documents?number=111028654,222006895` or as an array `/documents?number[]=111028654&number[]=222006895`.\n\n**Warning**: The maximum size of an HTTP request line in bytes is 4094. If this limit is exceeded, you will receive the HTTP error: `414 Request-URI Too Large`\n\n### Escape commas in query\n\nYou can escape commans in query `name=Patrick\\, Peter` if you submit the header `X-Easybill-Escape: true` in your request.\n\n## Property login_id\n\nThis is the login of your admin or employee account.\n\n## Date and Date-Time format\nPlease use the timezone `Europe/Berlin`.\n* **date** = *Y-m-d* = `2016-12-31`\n* **date-time** = *Y-m-d H:i:s* = `2016-12-31 03:13:37`\n\nDate or datetime can be `null` because the attributes have been added later and the entry is older." + }, + "tags": [ + { + "name": "customer", + "description": "Everything about your customers" + }, + { + "name": "customer group", + "description": "Groups for customer" + }, + { + "name": "discount", + "description": "Discounts for positions and position groups" + }, + { + "name": "document", + "description": "Invoices, offers, etc." + }, + { + "name": "document payment" + }, + { + "name": "position" + }, + { + "name": "position group" + }, + { + "name": "project" + }, + { + "name": "task" + }, + { + "name": "text template" + }, + { + "name": "time tracking" + }, + { + "name": "sepa payment" + }, + { + "name": "serial number" + }, + { + "name": "stock" + }, + { + "name": "webhook" + }, + { + "name": "pdf templates", + "description": "PDF Templates for documents" + }, + { + "name": "logins", + "description": "Informations regarding the logins / employees" + }, + { + "name": "document version", + "description": "Versions of documents" + } + ], + "host": "api.easybill.de", + "basePath": "/rest/v1", + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "securityDefinitions": { + "Bearer": { + "type": "apiKey", + "name": "Authorization", + "in": "header", + "description": "Please use the following Format: **Bearer **" + }, + "basicAuth": { + "type": "basic" + } + }, + "security": [ + { + "Bearer": [] + }, + { + "basicAuth": [] + } + ], + "parameters": { + "LIMIT": { + "in": "query", + "name": "limit", + "description": "Limited the result. Default is 100. Maximum can be 1000.", + "type": "integer", + "required": false, + "minimum": 1, + "maximum": 1000 + }, + "PAGE": { + "in": "query", + "name": "page", + "description": "Set current Page. Default is 1.", + "type": "integer", + "required": false, + "minimum": 1 + } + }, + "paths": { + "/stocks": { + "get": { + "summary": "Fetch a list of stock entries for positions", + "tags": [ + "stock" + ], + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "position_id", + "description": "Filter stock entries by position id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "document_id", + "description": "Filter stock entries by document id.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Stocks" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "summary": "Create a stock entry for a position", + "tags": [ + "stock" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Stock" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Stock" + } + }, + "400": { + "description": "Invalid position_id or stock_count" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/stocks/{id}": { + "get": { + "summary": "Fetch an stock entry for a position", + "tags": [ + "stock" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the stock entry that needs to be fetched", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Stock" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/serial-numbers": { + "get": { + "summary": "Fetch a list of serial numbers for positions", + "tags": [ + "serial number" + ], + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "position_id", + "description": "Filter serial numbers by position id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "document_id", + "description": "Filter serial numbers by document id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "in_use", + "description": "Filter serial numbers by usage.", + "required": false, + "type": "boolean" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/SerialNumbers" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "summary": "Create s serial number for a position", + "tags": [ + "serial number" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/SerialNumber" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/SerialNumber" + } + }, + "400": { + "description": "Invalid PositionID" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/serial-numbers/{id}": { + "get": { + "summary": "Fetch a serial number for a position", + "tags": [ + "serial number" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the serial number that needs to be fetched", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/SerialNumber" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "summary": "Delete a serial number for a position", + "tags": [ + "serial number" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the serial number that needs to be deleted", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "400": { + "description": "Serial number in use. Operation failed." + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/logins": { + "get": { + "tags": [ + "logins" + ], + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Logins" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/logins/{id}": { + "get": { + "tags": [ + "logins" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the login that needs to be fetched", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Login" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/customers": { + "get": { + "tags": [ + "customer" + ], + "summary": "Fetch customers list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "group_id", + "description": "Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "additional_group_id", + "description": "Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "number", + "description": "Filter customers by number. You can add multiple numbers separate by comma like no,no,no.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "country", + "description": "Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "zip_code", + "description": "Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "emails", + "description": "Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "first_name", + "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "last_name", + "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "company_name", + "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "created_at", + "description": "Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Customers" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "customer" + ], + "summary": "Create customer", + "description": "", + "parameters": [ + { + "in": "query", + "name": "type", + "description": "Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\".", + "required": false, + "type": "string", + "enum": [ + "CUSTOMER", + "SUPPLIER", + "CUSTOMER,SUPPLIER" + ], + "default": "CUSTOMER" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Customer" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Customer" + } + }, + "400": { + "description": "Invalid Customer" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/customers/{id}": { + "get": { + "tags": [ + "customer" + ], + "summary": "Fetch customer", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of customer that needs to be fetched", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Customer" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "customer" + ], + "summary": "Update Customer", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of customer that needs to be updated", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "query", + "name": "type", + "description": "Controls the type of the customer. If provided and the field \"number\" or \"supplier_number\" is empty or omitted, the type will force the generation of the relevant number if applicable. I. e. omitting \"supplier_number\" but providing the query parameter \"SUPPLIER\" will generate a \"supplier_number\".", + "required": false, + "type": "string", + "enum": [ + "CUSTOMER", + "SUPPLIER", + "CUSTOMER,SUPPLIER" + ], + "default": "CUSTOMER" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Customer" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Customer" + } + }, + "400": { + "description": "Invalid Customer" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "customer" + ], + "summary": "Delete customer", + "description": "", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of customer that needs to be deleted", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/customers/{customerId}/contacts": { + "get": { + "tags": [ + "contact" + ], + "summary": "Fetch customer contact list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "path", + "name": "customerId", + "description": "ID of customer that needs to be fetched", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Contacts" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "contact" + ], + "summary": "Create new contact", + "parameters": [ + { + "in": "path", + "name": "customerId", + "description": "ID of customer", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/Contact" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Contact" + } + }, + "400": { + "description": "Invalid contact" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/customers/{customerId}/contacts/{id}": { + "get": { + "tags": [ + "contact" + ], + "summary": "Fetch contact", + "parameters": [ + { + "in": "path", + "name": "customerId", + "description": "ID of customer", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "path", + "name": "id", + "description": "ID of contact", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Contact" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "contact" + ], + "summary": "Update Contact", + "parameters": [ + { + "in": "path", + "name": "customerId", + "description": "ID of customer", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "path", + "name": "id", + "description": "ID of contact", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/Contact" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Contact" + } + }, + "400": { + "description": "Invalid contact" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "contact" + ], + "summary": "Delete contact", + "description": "", + "parameters": [ + { + "in": "path", + "name": "customerId", + "description": "ID of customer", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "path", + "name": "id", + "description": "ID of contact", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/discounts/position": { + "get": { + "tags": [ + "discount" + ], + "summary": "Fetch list of position discounts", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "customer_id", + "description": "Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPositions" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "discount" + ], + "summary": "Create a new position discount", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DiscountPosition" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPosition" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/discounts/position/{id}": { + "get": { + "tags": [ + "discount" + ], + "summary": "Fetch specified position discount by id", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the discount", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPosition" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "discount" + ], + "summary": "Update a position discount", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the to be soon updated discount", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/DiscountPosition" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPosition" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "discount" + ], + "summary": "Delete the specified position discount", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the to be soon deleted discount", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/discounts/position-group": { + "get": { + "tags": [ + "discount" + ], + "summary": "Fetch list of position-group discounts", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "customer_id", + "description": "Filter discounts by customer_id. You can add multiple customer_ids separate by comma like id,id,id.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPositionGroups" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "discount" + ], + "summary": "Create a new position-group discount", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DiscountPositionGroup" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPositionGroup" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/discounts/position-group/{id}": { + "get": { + "tags": [ + "discount" + ], + "summary": "Fetch specified position-group discount by id", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the discount", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPositionGroup" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "discount" + ], + "summary": "Update a position-group discount", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the to be soon updated discount", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": false, + "schema": { + "$ref": "#/definitions/DiscountPositionGroup" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DiscountPositionGroup" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "discount" + ], + "summary": "Delete the specified position-group discount", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of the to be soon deleted discount", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents": { + "get": { + "tags": [ + "document" + ], + "summary": "Fetch documents list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "type", + "description": "Filter documents by type. Multiple typs seperate with , like type=INVOICE,CREDIT.", + "required": false, + "type": "string", + "enum": [ + "INVOICE", + "RECURRING", + "CREDIT", + "OFFER", + "REMINDER", + "DUNNING", + "STORNO", + "STORNO_CREDIT", + "DELIVERY", + "PDF", + "CHARGE", + "CHARGE_CONFIRM", + "LETTER", + "ORDER", + "PROFORMA_INVOICE", + "STORNO_PROFORMA_INVOICE" + ] + }, + { + "in": "query", + "name": "is_draft", + "description": "Filter documents by draft flag.", + "required": false, + "type": "string", + "enum": [ + "0", + "1" + ] + }, + { + "in": "query", + "name": "is_archive", + "description": "Filter documents by archive flag.", + "required": false, + "type": "string", + "enum": [ + "0", + "1" + ] + }, + { + "in": "query", + "name": "customer_id", + "description": "Filter documents by customer_id. You can add multiple customer_is separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "project_id", + "description": "Filter documents by project_id. You can add multiple project_id separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "ref_id", + "description": "Filter documents by ref_id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "document_date", + "description": "Filter documents by document_date. You can filter one date with document_date=2014-12-10 or between like 2015-01-01,2015-12-31.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "paid_at", + "description": "Filter documents by paid_at. You can filter one date with paid_at=2014-12-10 or between like 2015-01-01,2015-12-31. With paid_at=null you get all unpaid documents.", + "type": "string", + "required": false + }, + { + "in": "query", + "name": "title", + "description": "Filter documents by title.", + "type": "string", + "required": false + }, + { + "in": "query", + "name": "number", + "description": "Filter documents by number.", + "type": "string", + "required": false + }, + { + "in": "query", + "name": "cancel_id", + "description": "Filter documents by cancel_id. You can add multiple ids separate by comma like id,id,id. With cancel_id=null you get all not canceled documents.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "fulfillment_country", + "description": "Filter documents by fulfillment_country.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "vat_country", + "description": "Filter documents by vat_country.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "shipping_country", + "description": "Filter documents by shipping_country.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "status", + "description": "Filter documents by status. Keep in mind that not every document type has a status.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "edited_at", + "description": "Filter documents by edited_at. You can filter one date with edited_at=2014-12-10 or between like 2015-01-01,2015-12-31.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Documents" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "document" + ], + "summary": "Create document", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Document" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}": { + "get": { + "tags": [ + "document" + ], + "summary": "Fetch document", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "document" + ], + "summary": "Update document", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "query", + "name": "refresh_customer_data", + "description": "Forces refreshing of the customer data.", + "required": false, + "type": "boolean", + "enum": [ + "false", + "true" + ] + }, + { + "in": "query", + "name": "reason_for_change", + "description": "A string that is saved on the document version as reason. This value takes only affect if you update an already finalized document and provide this value.", + "required": false, + "type": "string", + "minLength": 1, + "maxLength": 255 + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Document" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "400": { + "description": "Invalid Document" + }, + "409": { + "description": "Resource is locked. This status is returned if a process is currently running which locks the requested resource. Try again later." + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "document" + ], + "summary": "Delete document", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "409": { + "description": "Resource is locked. This status is returned if a process is currently running which locks the requested resource. Try again later." + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/done": { + "put": { + "tags": [ + "document" + ], + "summary": "To complete a document.", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "query", + "name": "reason_for_change", + "description": "A string that is saved on the document version as reason.", + "required": false, + "type": "string", + "minLength": 1, + "maxLength": 255 + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "404": { + "description": "Not found" + }, + "409": { + "description": "Resource is locked. This status is returned if a process is currently running which locks the requested resource. Try again later." + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/cancel": { + "post": { + "tags": [ + "document" + ], + "summary": "Cancel document", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "query", + "name": "use_text_from_template", + "description": "Use standard texts from the template.", + "required": false, + "type": "boolean", + "default": "false" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/send/{type}": { + "post": { + "tags": [ + "document" + ], + "summary": "Send document", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "path", + "name": "type", + "required": true, + "type": "string", + "enum": [ + "email", + "fax", + "post" + ] + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PostBoxRequest" + } + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/pdf": { + "get": { + "tags": [ + "document" + ], + "summary": "Fetch pdf document", + "produces": [ + "application/pdf" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "type": "string", + "format": "binary" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/download": { + "get": { + "tags": [ + "document" + ], + "summary": "Fetch the document in best fitting format to the given Accept header", + "produces": [ + "application/pdf", + "application/pdf;format=zugferd;version=1.0.0", + "application/pdf;format=zugferd;version=2.2.0", + "application/xml;format=xrechnung;version=2.3.0", + "application/xml;format=xrechnung;version=3.0.1" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "header", + "name": "Accept", + "description": "The preferred format of the requested binary. Preferred format and format version can be specified with custom parameters 'format' and 'version', see 'x-examples' below. Allowed mime types are currently 'application/pdf' with optional format 'zugferd' and 'application/xml' with the supported format 'xrechnung'. In both cases, **if** the 'format' parameter is specified, a 'version' parameter **can** be added, following SemVer, allowing \\* as wildcards. If no 'version' parameter is provided, the highest version fitting the format will be used. So 'application/pdf;format=zugferd;version=\\*' is equal to 'application/pdf;format=zugferd;', but 'application/pdf;format=zugferd;version=3\\.*' can explicitly require a version of at least 3.0 and higher.", + "required": false, + "type": "string", + "x-examples": { + "any pdf": "", + "any xml": "application/xml", + "any zugferd pdf": "application/pdf;format=zugferd", + "any zugferd pdf of 2.x, but not 3.x or higher": "application/pdf;format=zugferd;version=2.*", + "any zugferd pdf of 3.x, else any xrechnung xml over any other pdf": "application/pdf;format=zugferd;version=3.*,application/xml;format=xrechnung;q=0.6,application/pdf;q=0.3" + } + } + ], + "responses": { + "200": { + "description": "Successful operation, a binary matching the defined expectations via 'Accept' header could be found and will be returned. The 'Content-Type' header of the response will contain the exact pdf format provided.", + "schema": { + "type": "string", + "format": "binary" + } + }, + "404": { + "description": "Not found" + }, + "406": { + "description": "No matching format of the document is available" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/jpg": { + "get": { + "tags": [ + "document" + ], + "summary": "Download a document as an jpeg-image", + "produces": [ + "image/jpeg" + ], + "parameters": [ + { + "in": "query", + "name": "offset", + "description": "The page of the document where the image should start.", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "in": "query", + "name": "limit", + "description": "The page of the document where the image should end.", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "type": "string", + "format": "binary" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/{type}": { + "post": { + "tags": [ + "document" + ], + "summary": "Convert an existing document to one of a different type", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "path", + "name": "type", + "description": "The target document type", + "required": true, + "type": "string", + "enum": [ + "DUNNING", + "REMINDER", + "CHARGE_CONFIRM", + "CHARGE", + "CREDIT", + "DELIVERY", + "INVOICE", + "ORDER" + ] + }, + { + "in": "query", + "name": "pdf_template", + "description": "The ID of the printer template to use. Defaults to 'DE' if not given.", + "required": false, + "type": "string", + "default": "DE" + } + ], + "responses": { + "201": { + "description": "Successful operation", + "headers": { + "Location": { + "type": "string", + "format": "uri", + "description": "Absolute URL to the newly created document" + } + }, + "schema": { + "$ref": "#/definitions/Document" + } + }, + "400": { + "description": "Invalid target document type" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/versions": { + "get": { + "tags": [ + "document version" + ], + "summary": "List all versions of a given document", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DocumentVersions" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/versions/{versionId}": { + "get": { + "tags": [ + "document version" + ], + "summary": "Show a single version of a given document", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "path", + "name": "versionId", + "description": "ID of document version", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DocumentVersion" + } + }, + "404": { + "description": "Document Version does not exist" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/documents/{id}/versions/{versionId}/items/{versionItemId}/download": { + "get": { + "tags": [ + "document version" + ], + "summary": "Download a specific file for a single version of a given document", + "produces": [ + "application/pdf", + "text/xml" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "path", + "name": "versionId", + "description": "ID of document version", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "path", + "name": "versionItemId", + "description": "ID of document version item", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "type": "string", + "format": "binary" + } + }, + "404": { + "description": "Document Version does not exist" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/customer-groups": { + "get": { + "tags": [ + "customer group" + ], + "summary": "Fetch customer group list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/CustomerGroups" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "customer group" + ], + "summary": "Create customer group", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CustomerGroup" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/CustomerGroup" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/customer-groups/{id}": { + "get": { + "tags": [ + "customer group" + ], + "summary": "Fetch customer group", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of customer group", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/CustomerGroup" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "customer group" + ], + "summary": "Update customer group", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of customer goup", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CustomerGroup" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/CustomerGroup" + } + }, + "400": { + "description": "Invalid customer group" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "customer group" + ], + "summary": "Delete customer group", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of customer group", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/tasks": { + "get": { + "tags": [ + "task" + ], + "summary": "Fetch tasks list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Tasks" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "task" + ], + "summary": "Create task", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Task" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Task" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/tasks/{id}": { + "get": { + "tags": [ + "task" + ], + "summary": "Fetch task", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of task", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Task" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "task" + ], + "summary": "Update task", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of task", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Task" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Task" + } + }, + "400": { + "description": "Invalid task" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "task" + ], + "summary": "Delete task", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of task", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/projects": { + "get": { + "tags": [ + "project" + ], + "summary": "Fetch projects list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "customer_id", + "description": "Filter projects by customer_id. You can add multiple ids separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "status", + "description": "Filter projects by status.", + "required": false, + "type": "string", + "enum": [ + "DONE", + "OPEN", + "CANCEL" + ] + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Projects" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "project" + ], + "summary": "Create project", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Project" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Project" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/projects/{id}": { + "get": { + "tags": [ + "project" + ], + "summary": "Fetch project", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of project", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Project" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "project" + ], + "summary": "Update project", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of project", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Project" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Project" + } + }, + "400": { + "description": "Invalid project" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "project" + ], + "summary": "Delete project", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of project", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/positions": { + "get": { + "tags": [ + "position" + ], + "summary": "Fetch positions list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "type", + "description": "Filter positions by type.", + "required": false, + "type": "string", + "enum": [ + "TEXT", + "PRODUCT", + "SERVICE" + ] + }, + { + "in": "query", + "name": "number", + "description": "Filter positions by number. You can add multiple numbers separate by comma like no,no,no.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Positions" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "position" + ], + "summary": "Create position", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Position" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Position" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/positions/{id}": { + "get": { + "tags": [ + "position" + ], + "summary": "Fetch position", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of position", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Position" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "position" + ], + "summary": "Update position", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of position", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Position" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Position" + } + }, + "400": { + "description": "Invalid position" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "position" + ], + "summary": "Delete position", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of position", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/position-groups": { + "get": { + "tags": [ + "position group" + ], + "summary": "Fetch position group list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/PositionGroups" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "position group" + ], + "summary": "Create position group", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PositionGroup" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/PositionGroup" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/position-groups/{id}": { + "get": { + "tags": [ + "position group" + ], + "summary": "Fetch position group", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of position group", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/PositionGroup" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "position group" + ], + "summary": "Update position group", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of position goup", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PositionGroup" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/PositionGroup" + } + }, + "400": { + "description": "Invalid position group" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "position group" + ], + "summary": "Delete position group", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of position group", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/time-trackings": { + "get": { + "tags": [ + "time tracking" + ], + "summary": "Fetch time trackings list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "login_id", + "description": "Filter time-tracking by login_id. You can add multiple ids separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "project_id", + "description": "Filter time-tracking by project_id. You can add multiple ids separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "date_from_at", + "description": "Filter time-tracking by date_from_at. You can filter one date with date_from_at=2014-12-10 or between like 2015-01-01,2015-12-31.\nYou can also specify a specific time with date_from_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "date_thru_at", + "description": "Filter time-tracking by date_thru_at. You can filter one date with date_thru_at=2014-12-10 or between like 2015-01-01,2015-12-31.\nYou can also specify a specific time with date_thru_at=2014-12-10 12:30:00 or between like 2015-01-01 12:30:00,2015-01-01 13:00:00.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TimeTrackings" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "time tracking" + ], + "summary": "Create time tracking", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TimeTracking" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TimeTracking" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/time-trackings/{id}": { + "get": { + "tags": [ + "time tracking" + ], + "summary": "Fetch time tracking", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of time tracking", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TimeTracking" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "time tracking" + ], + "summary": "Update time tracking", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of time tracking", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TimeTracking" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TimeTracking" + } + }, + "400": { + "description": "Invalid time tracking" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "time tracking" + ], + "summary": "Delete time tracking", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of time tracking", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/text-templates": { + "get": { + "tags": [ + "text template" + ], + "summary": "Fetch text templates list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TextTemplates" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "text template" + ], + "summary": "Create text template", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TextTemplate" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TextTemplate" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/text-templates/{id}": { + "get": { + "tags": [ + "text template" + ], + "summary": "Fetch text template", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of text template", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TextTemplate" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "text template" + ], + "summary": "Update text template", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of text template", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TextTemplate" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/TextTemplate" + } + }, + "400": { + "description": "Invalid text template" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "text template" + ], + "summary": "Delete text template", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of text template", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/attachments": { + "get": { + "tags": [ + "attachment" + ], + "summary": "Fetch attachments list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Attachments" + } + } + } + }, + "post": { + "tags": [ + "attachment" + ], + "summary": "Create attachment", + "consumes": [ + "multipart/form-data" + ], + "parameters": [ + { + "in": "formData", + "name": "file", + "required": true, + "type": "file" + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Attachment" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/attachments/{id}": { + "get": { + "tags": [ + "attachment" + ], + "summary": "Fetch attachment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of attachment", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Attachment" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "attachment" + ], + "summary": "Update attachment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of attachment", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Attachment" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/Attachment" + } + }, + "400": { + "description": "Invalid attachment" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "attachment" + ], + "summary": "Delete attachment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of attachment", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/attachments/{id}/content": { + "get": { + "tags": [ + "attachment" + ], + "summary": "Fetch attachment content", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of attachment", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "type": "string", + "format": "binary" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/document-payments": { + "get": { + "tags": [ + "document payment" + ], + "summary": "Fetch document payments list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "document_id", + "description": "Filter payments by document_id. You can add multiple ids separate by comma like id,id,id.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "payment_at", + "description": "Filter payments by payment_at. You can filter one date with payment_at=2014-12-10 or between like 2015-01-01,2015-12-31.", + "required": false, + "type": "string" + }, + { + "in": "query", + "name": "reference", + "description": "Filter payments by reference. You can add multiple references separate by comma like id,id,id.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DocumentPayments" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "document payment" + ], + "summary": "Create document payment", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DocumentPayment" + } + }, + { + "in": "query", + "name": "paid", + "description": "Mark document as paid when amount less then payment amount.", + "required": false, + "type": "boolean" + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DocumentPayment" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/document-payments/{id}": { + "get": { + "tags": [ + "document payment" + ], + "summary": "Fetch document payment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document payment", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/DocumentPayment" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "document payment" + ], + "summary": "Delete document payment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of document payment", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/post-boxes": { + "get": { + "tags": [ + "post box" + ], + "summary": "Fetch post box list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "type", + "description": "Filter post boxes by type. Multiple typs seperate with , like type=EMAIL,FAX.", + "required": false, + "type": "string", + "enum": [ + "EMAIL", + "FAX", + "POST" + ] + }, + { + "in": "query", + "name": "status", + "description": "Filter post boxes by status.", + "required": false, + "type": "string", + "enum": [ + "WAITING", + "PREPARE", + "ERROR", + "OK", + "PROCESSING" + ] + }, + { + "in": "query", + "name": "document_id", + "description": "Filter post boxes by document_id. You can add multiple document ids separate by comma like id,id,id.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/PostBoxes" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/post-boxes/{id}": { + "get": { + "tags": [ + "post box" + ], + "summary": "Fetch post box", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of post box", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/PostBox" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "post box" + ], + "summary": "Delete post box", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of post box", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/sepa-payments": { + "get": { + "tags": [ + "sepa payment" + ], + "summary": "Fetch SEPA payments list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + }, + { + "in": "query", + "name": "document_id", + "description": "Filter SEPA payment by document_id. You can add multiple ids separate by comma like id,id,id.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/SEPAPayments" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "sepa payment" + ], + "summary": "Create SEPA payment", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SEPAPayment" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/SEPAPayment" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/sepa-payments/{id}": { + "get": { + "tags": [ + "sepa payment" + ], + "summary": "Fetch SEPA payment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of SEPA payment", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/SEPAPayment" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "sepa payment" + ], + "summary": "Update SEPA payment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of SEPA payment", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SEPAPayment" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/SEPAPayment" + } + }, + "400": { + "description": "Invalid SEPA payment" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "sepa payment" + ], + "summary": "Delete SEPA payment", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of SPEA payment", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/webhooks": { + "get": { + "tags": [ + "webhook" + ], + "summary": "Fetch WebHooks list", + "parameters": [ + { + "$ref": "#/parameters/LIMIT" + }, + { + "$ref": "#/parameters/PAGE" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/WebHooks" + } + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "post": { + "tags": [ + "webhook" + ], + "summary": "Create WebHook", + "parameters": [ + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WebHook" + } + } + ], + "responses": { + "201": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/WebHook" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/webhooks/{id}": { + "get": { + "tags": [ + "webhook" + ], + "summary": "Fetch WebHook", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of WebHook", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/WebHook" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "put": { + "tags": [ + "webhook" + ], + "summary": "Update WebHook", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of WebHook", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "in": "body", + "name": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WebHook" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/WebHook" + } + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + }, + "delete": { + "tags": [ + "webhook" + ], + "summary": "Delete WebHook", + "parameters": [ + { + "in": "path", + "name": "id", + "description": "ID of WebHook", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "204": { + "description": "Successful operation" + }, + "404": { + "description": "Not found" + }, + "429": { + "description": "Too Many Requests" + } + } + } + }, + "/pdf-templates": { + "get": { + "parameters": [ + { + "in": "query", + "name": "type", + "description": "Filters the templates by the specified type. You can specify several types comma-separated, like type,type,type.", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "INVOICE", + "PROFORMA_INVOICE", + "STORNO_PROFORMA_INVOICE", + "OFFER", + "CREDIT", + "STORNO", + "STORNO_CREDIT", + "CHARGE", + "CHARGE_CONFIRM", + "DUNNING", + "REMINDER", + "DELIVERY", + "LETTER", + "ORDER" + ] + } + } + ], + "tags": [ + "pdf templates" + ], + "summary": "Fetch PDF Templates list", + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "$ref": "#/definitions/PDFTemplates" + } + }, + "429": { + "description": "Too Many Requests" + } + } + } + } + }, + "definitions": { + "List": { + "type": "object", + "required": [ + "page", + "pages", + "limit", + "total" + ], + "properties": { + "page": { + "type": "integer", + "description": "The current page", + "example": 1 + }, + "pages": { + "type": "integer", + "description": "Max possible pages", + "example": 1 + }, + "limit": { + "type": "integer", + "description": "Items limitation. Max 1000", + "example": 100 + }, + "total": { + "type": "integer", + "description": "Total Items", + "example": 20 + } + } + }, + "AdvancedDataField": { + "type": "object", + "description": "EN16931 Business Term (BT field) for structured invoice data", + "required": [ + "identifier", + "value" + ], + "properties": { + "identifier": { + "type": "string", + "description": "BT field identifier (e.g. 'BT-10' for Buyer reference, 'BT-84' for Payment account identifier)", + "example": "BT-10" + }, + "value": { + "type": "string", + "description": "Field value", + "example": "Customer-Ref-123" + } + } + }, + "Customer": { + "type": "object", + "required": [ + "last_name", + "company_name" + ], + "properties": { + "acquire_options": { + "type": "integer", + "description": "1 = Empfehlung eines anderen Kunden, 2 = Zeitungsanzeige, 3 = Eigene Akquisition, 4 = Mitarbeiter Akquisition, 5 = Google, 6 = Gelbe Seiten, 7 = Kostenlose Internet Plattform, 8 = Bezahlte Internet Plattform", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "x-nullable": true, + "example": 5 + }, + "additional_groups_ids": { + "type": "array", + "example": [], + "items": { + "type": "integer", + "uniqueItems": true + } + }, + "bank_account": { + "type": "string", + "x-nullable": true, + "example": "123456789" + }, + "bank_account_owner": { + "type": "string", + "x-nullable": true, + "example": "Max Mustermann" + }, + "bank_bic": { + "type": "string", + "x-nullable": true, + "example": "DEUTDEFF" + }, + "bank_code": { + "type": "string", + "x-nullable": true, + "example": "50070024" + }, + "bank_iban": { + "type": "string", + "x-nullable": true, + "example": "DE89370400440532013000" + }, + "bank_name": { + "type": "string", + "x-nullable": true, + "example": "Musterbank" + }, + "birth_date": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": "2016-12-31" + }, + "cash_allowance": { + "type": "number", + "format": "float", + "x-nullable": true, + "example": 2, + "minimum": 0, + "maximum": 100 + }, + "cash_allowance_days": { + "type": "integer", + "default": 7, + "example": 7 + }, + "cash_discount": { + "type": "number", + "format": "float", + "x-nullable": true, + "example": 3 + }, + "cash_discount_type": { + "type": "string", + "enum": [ + "PERCENT", + "AMOUNT" + ], + "x-nullable": true, + "example": "PERCENT" + }, + "city": { + "type": "string", + "x-nullable": true, + "example": "Kaarst" + }, + "state": { + "type": "string", + "example": "NRW" + }, + "company_name": { + "type": "string", + "example": "easybill GmbH", + "x-nullable": true + }, + "country": { + "type": "string", + "example": "DE" + }, + "created_at": { + "type": "string", + "format": "date", + "readOnly": true + }, + "updated_at": { + "type": "string", + "format": "datetime", + "readOnly": true + }, + "delivery_title": { + "type": "string", + "example": "Dr." + }, + "delivery_city": { + "type": "string", + "x-nullable": true, + "example": "Hamburg" + }, + "delivery_state": { + "type": "string", + "example": "NRW" + }, + "delivery_company_name": { + "type": "string", + "x-nullable": true, + "example": "Musterfirma Logistik GmbH" + }, + "delivery_country": { + "type": "string", + "x-nullable": true, + "example": "DE" + }, + "delivery_first_name": { + "type": "string", + "x-nullable": true, + "example": "Erika" + }, + "delivery_last_name": { + "type": "string", + "x-nullable": true, + "example": "Musterfrau" + }, + "delivery_personal": { + "type": "boolean", + "example": false + }, + "delivery_salutation": { + "type": "integer", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "default": 0, + "description": "0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family" + }, + "delivery_street": { + "type": "string", + "x-nullable": true, + "example": "Lieferstraße 42" + }, + "delivery_suffix_1": { + "type": "string", + "x-nullable": true, + "example": "Hinterhaus" + }, + "delivery_suffix_2": { + "type": "string", + "x-nullable": true, + "example": "3. Etage" + }, + "delivery_zip_code": { + "type": "string", + "x-nullable": true, + "example": "20095" + }, + "display_name": { + "type": "string", + "readOnly": true + }, + "emails": { + "type": "array", + "items": { + "type": "string", + "maxItems": 3, + "uniqueItems": true + }, + "example": [ + "max.mustermann@easybill.de" + ] + }, + "fax": { + "type": "string", + "example": "+49 2154 89701 29", + "x-nullable": true + }, + "first_name": { + "type": "string", + "example": "Max", + "x-nullable": true + }, + "grace_period": { + "type": "integer", + "description": "will be replaced by its alias due_in_days.", + "x-nullable": true, + "example": 14 + }, + "due_in_days": { + "type": "integer", + "description": "due date in days", + "x-nullable": true, + "example": 14 + }, + "group_id": { + "type": "integer", + "x-nullable": true, + "example": 1 + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "info_1": { + "type": "string", + "x-nullable": true, + "example": "Kundennummer: 12345" + }, + "info_2": { + "type": "string", + "x-nullable": true, + "example": "Abteilung: Einkauf" + }, + "internet": { + "type": "string", + "x-nullable": true, + "example": "https://www.easybill.de" + }, + "last_name": { + "type": "string", + "example": "Mustermann", + "x-nullable": true + }, + "login_id": { + "type": "integer", + "format": "int64" + }, + "mobile": { + "type": "string", + "example": "+49 170 1234567", + "x-nullable": true + }, + "note": { + "type": "string", + "example": "Wichtiger Kunde, bevorzugte Betreuung", + "x-nullable": true + }, + "number": { + "type": "string", + "description": "Automatically generated if empty/omitted and when no type in query is provided or the type 'CUSTOMER', 'CUSTOMER,SUPPLIER'" + }, + "supplier_number": { + "type": "string", + "description": "Automatically generated if the type SUPPLIER or 'CUSTOMER,SUPPLIER' is provided as query parameter and the field supplier_number is empty/omitted." + }, + "payment_options": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 5 + ], + "description": "1 = Stets pünktliche Zahlung, 2 = überwiegend pünktliche Zahlung, 3 = überwiegend verspätete Zahlung, 5 = Grundsätzlich verspätete Zahlung", + "example": 1, + "x-nullable": true + }, + "personal": { + "type": "boolean", + "example": false, + "default": false + }, + "phone_1": { + "type": "string", + "example": "+49 2154 89701 20", + "x-nullable": true + }, + "phone_2": { + "type": "string", + "example": "+49 2154 89701 21", + "x-nullable": true + }, + "postbox": { + "type": "string", + "example": "Postfach 1234", + "x-nullable": true + }, + "postbox_city": { + "type": "string", + "example": "Düsseldorf", + "x-nullable": true + }, + "postbox_state": { + "type": "string", + "example": "NRW" + }, + "postbox_country": { + "type": "string", + "example": "DE", + "x-nullable": true + }, + "postbox_zip_code": { + "type": "string", + "example": "40213", + "x-nullable": true + }, + "sale_price_level": { + "type": "string", + "example": "SALEPRICE3", + "x-nullable": true, + "enum": [ + "SALEPRICE2", + "SALEPRICE3", + "SALEPRICE4", + "SALEPRICE5", + "SALEPRICE6", + "SALEPRICE7", + "SALEPRICE8", + "SALEPRICE9", + "SALEPRICE10" + ] + }, + "salutation": { + "type": "integer", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "default": 0, + "description": "0 = nothing, 1 = Mr, 2 = Mrs, 3 = Company, 4 = Mr & Mrs, 5 = Married couple, 6 = Family" + }, + "sepa_agreement": { + "type": "string", + "enum": [ + "BASIC", + "COR1", + "COMPANY", + "NULL" + ], + "description": "BASIC = SEPA-Basislastschrift, COR1 = SEPA-Basislastschrift COR1 (deprecated use BASIC instead), COMPANY = SEPA-Firmenlastschrift, NULL = Noch kein Mandat erteilt", + "example": "BASIC", + "x-nullable": true + }, + "sepa_agreement_date": { + "type": "string", + "format": "date", + "example": "2022-01-15", + "x-nullable": true + }, + "sepa_mandate_reference": { + "type": "string", + "example": "MANDAT-2022-0815", + "x-nullable": true + }, + "since_date": { + "type": "string", + "format": "date", + "example": "2020-03-01", + "x-nullable": true + }, + "street": { + "type": "string", + "example": "Düsselstr. 21", + "x-nullable": true + }, + "suffix_1": { + "type": "string", + "example": "c/o Musterfirma GmbH", + "x-nullable": true + }, + "suffix_2": { + "type": "string", + "example": "2. Stock, links", + "x-nullable": true + }, + "tax_number": { + "type": "string", + "example": "21/815/08150", + "x-nullable": true + }, + "court": { + "type": "string", + "example": "Berlin", + "x-nullable": true + }, + "court_registry_number": { + "type": "string", + "example": "HRB XXXXX X", + "x-nullable": true + }, + "tax_options": { + "type": "string", + "enum": [ + "nStb", + "nStbUstID", + "nStbNoneUstID", + "nStbIm", + "revc", + "IG", + "AL", + "sStfr", + "NULL" + ], + "description": "nStb = Nicht steuerbar (Drittland), nStbUstID = Nicht steuerbar (EU mit USt-IdNr.), nStbNoneUstID = Nicht steuerbar (EU ohne USt-IdNr.), revc = Steuerschuldwechsel §13b (Inland), IG = Innergemeinschaftliche Lieferung, AL = Ausfuhrlieferung, sStfr = sonstige Steuerbefreiung, NULL = Umsatzsteuerpflichtig", + "example": "IG", + "x-nullable": true + }, + "title": { + "type": "string", + "example": "Dr.", + "x-nullable": true + }, + "archived": { + "type": "boolean", + "example": false, + "x-nullable": false + }, + "vat_identifier": { + "type": "string", + "example": "DE814878557", + "x-nullable": true + }, + "zip_code": { + "type": "string", + "x-nullable": true, + "example": "41564" + }, + "document_pdf_type": { + "type": "string", + "enum": [ + "default", + "zugferd1", + "zugferd2_2", + "zugferd2_4_en16931", + "zugferd2_4_extended", + "xrechnung2_1_xml", + "xrechnung2_2_xml", + "xrechnung2_3_xml", + "xrechnung3_0_xml" + ], + "default": "default", + "description": "Type of PDF to use when sending a Document to the Customer." + }, + "buyer_reference": { + "type": "string", + "description": "Used as \"buyerReference\" in ZUGFeRD and as \"Leitweg-ID\" in the XRechnung format." + }, + "foreign_supplier_number": { + "type": "string", + "description": "The ID given to your company by the customer in his system." + } + } + }, + "CustomerSnapshot": { + "readOnly": true, + "type": "object", + "description": "A snapshot of the customer model which belongs to a document. This model is readonly and the state is final after finalization of the document. It's is identical to the state of the customer model at the time of finalization. Updates to the actual customer dataset won't affect this snapshot, however if you update the document the customer and therefore the customer snapshot may reflect a different state.", + "allOf": [ + { + "$ref": "#/definitions/Customer" + } + ] + }, + "Customers": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Customer" + } + } + } + } + ] + }, + "Contact": { + "type": "object", + "required": [ + "city", + "street" + ], + "properties": { + "city": { + "type": "string", + "example": "Musterstadt" + }, + "state": { + "type": "string", + "example": "NRW" + }, + "company_name": { + "type": "string", + "example": "Musterfirma GmbH", + "x-nullable": true + }, + "country": { + "type": "string", + "description": "Two-letter country code", + "example": "DE" + }, + "department": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Accounting" + }, + "emails": { + "type": "array", + "default": [], + "items": { + "type": "string", + "maxItems": 3, + "uniqueItems": true, + "example": "mustermann@easybill.de" + } + }, + "fax": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "+49 2154 89701 29" + }, + "first_name": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Max" + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "last_name": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Mustermann" + }, + "login_id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "mobile": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "+49 171 9876543" + }, + "note": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Ansprechpartner für technische Fragen" + }, + "personal": { + "type": "boolean", + "default": false + }, + "phone_1": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "+49 2154 89701 50" + }, + "phone_2": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "+49 2154 89701 51" + }, + "salutation": { + "type": "integer", + "description": "0: empty
1: Herrn
2: Frau
3: Firma
4: Herrn und Frau
5: Eheleute
6: Familie" + }, + "street": { + "type": "string", + "example": "Musterstr." + }, + "suffix_1": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Gebäude A" + }, + "suffix_2": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Raum 305" + }, + "title": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Prof. Dr." + }, + "zip_code": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "12345" + }, + "created_at": { + "type": "string", + "format": "datetime", + "readOnly": true, + "example": "2018-01-01 23:23:45" + }, + "updated_at": { + "type": "string", + "format": "datetime", + "readOnly": true, + "example": "2018-01-01 23:23:45" + } + } + }, + "Contacts": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Contact" + } + } + } + } + ] + }, + "DocumentPosition": { + "type": "object", + "properties": { + "number": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "ART-12345" + }, + "description": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Professionelle Webentwicklung" + }, + "document_note": { + "type": "string", + "example": "Test Note", + "description": "This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction." + }, + "quantity": { + "type": "number", + "maxLength": 10, + "format": "float", + "default": 1, + "example": 1 + }, + "quantity_str": { + "type": "string", + "maxLength": 10, + "description": "Use quantity_str if you want to set a quantity like: 1:30 h or 3x5 m. quantity_str overwrites quantity.", + "example": "1:30 h" + }, + "unit": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Stunde" + }, + "type": { + "type": "string", + "enum": [ + "POSITION", + "POSITION_NOCALC", + "TEXT" + ], + "default": "POSITION" + }, + "position": { + "type": "integer", + "description": "Automatic by default (first item: 1, second item: 2, ...)", + "example": 1 + }, + "single_price_net": { + "type": "number", + "format": "float", + "x-nullable": true, + "default": null, + "description": "Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)", + "example": 75 + }, + "single_price_gross": { + "type": "number", + "format": "float", + "description": "Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)" + }, + "vat_percent": { + "type": "number", + "format": "float", + "default": 0, + "example": 0 + }, + "discount": { + "type": "number", + "format": "float", + "x-nullable": true, + "default": null, + "example": 10 + }, + "discount_type": { + "type": "string", + "enum": [ + "PERCENT", + "AMOUNT", + "QUANTITY", + "FIX" + ], + "x-nullable": true, + "default": null, + "example": "PERCENT" + }, + "position_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "description": "If set, values are copied from the referenced position", + "example": 123456 + }, + "total_price_net": { + "type": "number", + "format": "float", + "description": "Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)", + "readOnly": true + }, + "total_price_gross": { + "type": "number", + "format": "float", + "description": "Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)", + "readOnly": true + }, + "total_vat": { + "type": "number", + "format": "float", + "readOnly": true + }, + "serial_number_id": { + "type": "string", + "readOnly": true, + "example": "SN-2023-001-ID" + }, + "serial_number": { + "type": "string", + "readOnly": true, + "example": "SN-2023-001" + }, + "booking_account": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "8400" + }, + "export_cost_1": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Kostenstelle 100" + }, + "export_cost_2": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Projekt ABC" + }, + "cost_price_net": { + "type": "number", + "format": "float", + "x-nullable": true, + "default": null, + "description": "Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)", + "example": 45.5 + }, + "cost_price_total": { + "type": "number", + "format": "float", + "readOnly": true, + "description": "Price in cents, despite being of type float (e.g. 150 = 1.50€, but also 150.0 = 1.50€)", + "example": 45.5 + }, + "cost_price_charge": { + "type": "number", + "format": "float", + "readOnly": true, + "example": 10 + }, + "cost_price_charge_type": { + "type": "string", + "readOnly": true, + "example": "PERCENT", + "enum": [ + "PERCENT", + "AMOUNT" + ] + }, + "itemType": { + "type": "string", + "enum": [ + "PRODUCT", + "SERVICE", + "UNDEFINED" + ], + "default": "UNDEFINED" + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + } + } + }, + "DocumentAddress": { + "type": "object", + "readOnly": true, + "description": "This information comes from the customer which can be set with customer_id.", + "properties": { + "salutation": { + "readOnly": true, + "type": "integer", + "description": "0: empty
1: Herrn
2: Frau
3: Firma
4: Herrn und Frau
5: Eheleute
6: Familie" + }, + "personal": { + "readOnly": true, + "type": "boolean", + "example": false + }, + "title": { + "readOnly": true, + "type": "string", + "example": "Dr." + }, + "first_name": { + "readOnly": true, + "type": "string", + "example": "Max" + }, + "last_name": { + "readOnly": true, + "type": "string", + "example": "Mustermann" + }, + "suffix_1": { + "readOnly": true, + "type": "string", + "example": "Abteilung Vertrieb" + }, + "suffix_2": { + "readOnly": true, + "type": "string", + "example": "3. Etage" + }, + "company_name": { + "readOnly": true, + "type": "string", + "example": "Musterunternehmen AG" + }, + "street": { + "readOnly": true, + "type": "string", + "example": "Musterstr." + }, + "zip_code": { + "readOnly": true, + "type": "string", + "example": "12345" + }, + "city": { + "readOnly": true, + "type": "string", + "example": "Musterstadt" + }, + "state": { + "readOnly": true, + "type": "string", + "example": "NRW" + }, + "country": { + "readOnly": true, + "type": "string", + "example": "DE" + } + } + }, + "DocumentRecurring": { + "description": "This object is only available in document type RECURRING.", + "type": "object", + "required": [ + "next_date" + ], + "properties": { + "next_date": { + "type": "string", + "format": "date", + "description": "Must be in the future", + "example": "2020-02-01" + }, + "frequency": { + "type": "string", + "enum": [ + "DAILY", + "WEEKLY", + "MONTHLY", + "YEARLY" + ], + "default": "MONTHLY" + }, + "frequency_special": { + "type": "string", + "enum": [ + "LASTDAYOFMONTH" + ], + "x-nullable": true, + "default": null, + "example": null + }, + "interval": { + "type": "integer", + "default": 1, + "example": 1 + }, + "end_date_or_count": { + "type": "string", + "description": "Date of last exectution day or number of times to exectute", + "x-nullable": true, + "default": null, + "example": null + }, + "status": { + "type": "string", + "enum": [ + "RUNNING", + "PAUSE", + "STOP", + "WAITING" + ], + "default": "WAITING" + }, + "as_draft": { + "type": "boolean", + "default": false + }, + "is_notify": { + "type": "boolean", + "default": false + }, + "send_as": { + "type": "string", + "enum": [ + "EMAIL", + "FAX", + "POST" + ], + "x-nullable": true, + "default": null, + "example": null + }, + "is_sign": { + "type": "boolean", + "default": false + }, + "is_paid": { + "type": "boolean", + "default": false + }, + "paid_date_option": { + "type": "string", + "description": "Option is used to determine what date is used for the payment if is_paid is true. \"next_valid_date\" selects the next workday in regards to the created date of the document if the date falls on a saturday or sunday.", + "default": "created_date", + "enum": [ + "created_date", + "due_date", + "next_valid_date" + ] + }, + "is_sepa": { + "type": "boolean", + "default": false + }, + "sepa_local_instrument": { + "type": "string", + "description": "COR1 is deprecated use CORE instead.", + "enum": [ + "CORE", + "COR1", + "B2B" + ], + "x-nullable": true, + "default": null, + "example": null + }, + "sepa_sequence_type": { + "type": "string", + "enum": [ + "FRST", + "OOFF", + "FNAL", + "RCUR" + ], + "x-nullable": true, + "default": null, + "example": null + }, + "sepa_reference": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "sepa_remittance_information": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "target_type": { + "type": "string", + "enum": [ + "INVOICE", + "CREDIT", + "ORDER", + "OFFER" + ], + "default": "INVOICE", + "description": "The document type that will be generated. Can not be changed on existing documents." + } + } + }, + "ServiceDate": { + "description": "This object is only available in document type INVOICE or CREDIT.", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "DEFAULT", + "SERVICE", + "DELIVERY" + ], + "description": "With DEFAULT no other fields are required and this message will be printed: 'Invoice date coincides with the time of supply'.
For SERVICE or DELIVERY exactly one of the following fields must be set: date, date_from and date_to or text." + }, + "date": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": "2019-02-01" + }, + "date_from": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": null + }, + "date_to": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": null + }, + "text": { + "type": "string", + "default": null, + "x-nullable": true, + "example": null + } + } + }, + "Document": { + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/DocumentAddress" + }, + "advanced_data_fields": { + "type": "array", + "description": "EN16931 Business Terms (BT fields) for structured invoice data. On update the submitted list fully replaces the existing fields — send an empty array to clear all.", + "example": [], + "items": { + "$ref": "#/definitions/AdvancedDataField" + } + }, + "attachment_ids": { + "type": "array", + "readOnly": true, + "example": [], + "items": { + "type": "integer", + "uniqueItems": true + } + }, + "label_address": { + "$ref": "#/definitions/DocumentAddress" + }, + "amount": { + "readOnly": true, + "type": "integer", + "description": "Amount in cents (e.g. \"150\" = 1.50€)" + }, + "amount_net": { + "readOnly": true, + "type": "integer", + "description": "Amount in cents (e.g. \"150\" = 1.50€)" + }, + "anonymize_due_date": { + "type": "string", + "format": "date", + "example": "2019-02-07", + "description": "A date which signals when to anonymize the document. Must be in the future. Turns into a read only field if the document is anonymized", + "x-nullable": true + }, + "anonymize_status": { + "type": "string", + "enum": [ + "NOT_ANONYMIZED", + "ANONYMIZED" + ], + "description": "This field signals if the document was anonymized", + "default": "NOT_ANONYMIZED", + "readOnly": true + }, + "anonymized_at": { + "type": "string", + "format": "datetime", + "example": "2019-02-07 00:00:00", + "readOnly": true, + "x-nullable": true + }, + "bank_debit_form": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "billing_country": { + "type": "string", + "readOnly": true, + "example": null + }, + "calc_vat_from": { + "type": "integer", + "enum": [ + 0, + 1 + ], + "description": "0 === Net, 1 === Gross.", + "default": 0, + "example": 0 + }, + "cancel_id": { + "type": "integer", + "format": "int64", + "description": "ID from the cancel document. Only for document type INVOICE.", + "readOnly": true, + "example": null + }, + "cash_allowance": { + "type": "number", + "format": "float", + "x-nullable": true, + "default": null, + "example": null, + "description": "Cash allowance percentage. If not provided, inherits from customer when available." + }, + "cash_allowance_days": { + "type": "integer", + "x-nullable": true, + "default": null, + "example": null, + "description": "Days for cash allowance. If not provided, inherits from customer when available." + }, + "cash_allowance_text": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "contact_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "contact_label": { + "type": "string", + "default": "", + "example": "" + }, + "contact_text": { + "type": "string", + "default": "", + "example": "" + }, + "created_at": { + "readOnly": true, + "type": "string", + "format": "date-time", + "example": "2019-02-01 11:16:52" + }, + "currency": { + "type": "string", + "default": "EUR", + "example": "EUR" + }, + "customer_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "customer_snapshot": { + "$ref": "#/definitions/CustomerSnapshot" + }, + "discount": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "discount_type": { + "type": "string", + "enum": [ + "PERCENT", + "AMOUNT" + ], + "x-nullable": true, + "default": null, + "example": null + }, + "document_date": { + "type": "string", + "format": "date", + "example": "2019-02-07" + }, + "due_date": { + "type": "string", + "format": "date", + "readOnly": true, + "description": "To change the value use grace_period.", + "example": null + }, + "edited_at": { + "readOnly": true, + "type": "string", + "format": "date-time", + "example": "2019-02-07 11:54:10" + }, + "external_id": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "replica_url": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "grace_period": { + "type": "integer", + "description": "will be replaced by its alias due_in_days.", + "x-nullable": true, + "example": null + }, + "due_in_days": { + "type": "integer", + "description": "due date in days. If not provided, inherits from customer when available", + "x-nullable": true, + "example": null + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "is_acceptable_on_public_domain": { + "type": "boolean", + "default": false, + "example": false, + "description": "Indicates if a document can be accepted by the end customer through the document's public access page." + }, + "is_archive": { + "type": "boolean", + "default": false, + "example": false + }, + "is_draft": { + "type": "boolean", + "readOnly": true, + "description": "This property is read only. To finish the document call /documents/{id}/done.", + "example": true + }, + "is_replica": { + "type": "boolean", + "description": "Marks a document as a replica from another software.", + "default": false, + "example": false + }, + "is_oss": { + "type": "boolean", + "description": "Indicates if a document is a one-stop-shop document", + "default": false, + "example": false + }, + "item_notes": { + "description": "Field holds all unique document_note of items for the document", + "type": "array", + "readOnly": true, + "items": { + "type": "string" + } + }, + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/DocumentPosition" + } + }, + "last_postbox_id": { + "type": "integer", + "format": "int64", + "readOnly": true, + "example": null + }, + "login_id": { + "type": "integer", + "format": "int64", + "example": null, + "description": "If omitted or null, the currently active login is used." + }, + "number": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "order_number": { + "type": "string", + "default": "" + }, + "buyer_reference": { + "type": "string", + "default": "" + }, + "paid_amount": { + "type": "integer", + "readOnly": true + }, + "paid_at": { + "type": "string", + "format": "date", + "readOnly": true, + "example": null + }, + "pdf_pages": { + "type": "integer", + "readOnly": true + }, + "pdf_template": { + "type": "string", + "description": "Default template is null or 'DE', default english is 'EN' and for all others use the numeric template ID.", + "example": null + }, + "payment_link_enabled": { + "type": "boolean", + "description": "Whether the payment link is shown on this document. Overrides the setting from the referenced template.", + "default": false, + "example": false + }, + "payment_link_locale": { + "type": "string", + "description": "Language of the payment link text on the document.", + "enum": [ + "de", + "en" + ], + "default": "de", + "example": "de" + }, + "project_id": { + "type": "integer", + "x-nullable": true, + "default": null, + "example": null + }, + "recurring_options": { + "$ref": "#/definitions/DocumentRecurring" + }, + "ref_id": { + "type": "integer", + "format": "int64", + "description": "Reference document id", + "x-nullable": true, + "default": null, + "example": null + }, + "root_id": { + "type": "integer", + "format": "int64", + "description": "Root document id", + "x-nullable": true, + "default": null, + "example": null, + "readOnly": true + }, + "service_date": { + "$ref": "#/definitions/ServiceDate" + }, + "shipping_country": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "status": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null, + "description": "This value can only be used in document type DELIVERY, ORDER, CHARGE or OFFER. NULL is default = not set.", + "enum": [ + "ACCEPT", + "DONE", + "DROPSHIPPING", + "CANCEL" + ] + }, + "text": { + "type": "string", + "example": "Vielen Dank für Ihren Auftrag!\n\nBitte begleichen Sie den offenen Betrag bis zum %DOKUMENT.DATUM-FAELLIG%.\n\nMit freundlichen Grüßen\n\n%FIRMA.FIRMA%\n" + }, + "text_prefix": { + "type": "string", + "example": "%KUNDE.ANREDE%,\nnachfolgend berechnen wir Ihnen wie vorab besprochen:\n" + }, + "text_tax": { + "type": "string", + "x-nullable": true, + "default": null, + "description": "Overwrites the default vat-option text from the document layout. It is only displayed in documents with the type other than: Delivery, Dunning, Reminder or Letter and a different vat-option than null" + }, + "title": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "Invoice for Order #001" + }, + "type": { + "type": "string", + "enum": [ + "INVOICE", + "RECURRING", + "CREDIT", + "OFFER", + "REMINDER", + "DUNNING", + "STORNO", + "STORNO_CREDIT", + "DELIVERY", + "PDF", + "CHARGE", + "CHARGE_CONFIRM", + "LETTER", + "ORDER", + "PROFORMA_INVOICE", + "STORNO_PROFORMA_INVOICE" + ], + "description": "Can only set on create.", + "default": "INVOICE" + }, + "use_shipping_address": { + "type": "boolean", + "description": "If true and customer has shipping address then it will be used.", + "default": false, + "example": false + }, + "vat_country": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "vat_id": { + "type": "string", + "readOnly": true, + "default": "", + "example": "DE999999999" + }, + "fulfillment_country": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "vat_option": { + "type": "string", + "enum": [ + "NULL", + "nStb", + "nStbUstID", + "nStbNoneUstID", + "nStbIm", + "revc", + "IG", + "AL", + "sStfr", + "smallBusiness" + ], + "description": "NULL: Normal steuerbar
nStb: Nicht steuerbar (Drittland)
nStbUstID: Nicht steuerbar (EU mit USt-IdNr.)
nStbNoneUstID: Nicht steuerbar (EU ohne USt-IdNr.)
nStbIm: Nicht steuerbarer Innenumsatz
revc: Steuerschuldwechsel §13b (Inland)
IG: Innergemeinschaftliche Lieferung
AL: Ausfuhrlieferung
sStfr: sonstige Steuerbefreiung
smallBusiness: Kleinunternehmen (Keine MwSt.)", + "x-nullable": true, + "default": null, + "example": null + }, + "file_format_config": { + "type": "array", + "items": { + "$ref": "#/definitions/FileFormatConfig" + } + } + } + }, + "Documents": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Document" + } + } + } + } + ] + }, + "FileFormatConfig": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "example": "default", + "enum": [ + "default", + "default_without_stationery", + "zugferd1", + "zugferd2_2", + "zugferd2_4_en16931", + "zugferd2_4_extended", + "xrechnung2_2_xml", + "xrechnung2_3_xml", + "xrechnung3_0_xml" + ] + } + } + }, + "DocumentVersion": { + "type": "object", + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "readOnly": true, + "example": "2023-08-03 17:16:15" + }, + "document_id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/DocumentVersionItem" + } + }, + "reason": { + "type": "string", + "readOnly": true, + "example": "Added another position to the document" + } + } + }, + "DocumentVersionItem": { + "type": "object", + "properties": { + "document_version_item_type": { + "type": "string", + "readOnly": true, + "example": "default", + "enum": [ + "default", + "default_without_stationery", + "xrechnung2_2_xml", + "xrechnung2_3_xml", + "xrechnung3_0_xml", + "zugferd1", + "zugferd2_2", + "zugferd2_4_en16931", + "zugferd2_4_extended" + ] + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + } + } + }, + "DocumentVersions": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/DocumentVersion" + } + } + } + } + ] + }, + "CustomerGroup": { + "type": "object", + "required": [ + "number", + "name" + ], + "properties": { + "name": { + "type": "string", + "example": "Important Customers" + }, + "description": { + "type": "string", + "example": "Our most important customers", + "x-nullable": true, + "default": null + }, + "number": { + "type": "string", + "example": "001", + "description": "Can be chosen freely" + }, + "display_name": { + "type": "string", + "readOnly": true, + "example": "001 - Important Customers" + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + } + } + }, + "CustomerGroups": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomerGroup" + } + } + } + } + ] + }, + "Task": { + "type": "object", + "required": [ + "name", + "status" + ], + "properties": { + "category": { + "type": "string", + "enum": [ + "CALL", + "EMAIL", + "FAX", + "LUNCH", + "MEETING", + "TRAVEL", + "CUSTOM" + ], + "x-nullable": true, + "default": null + }, + "category_custom": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null, + "description": "The name of your custom category. Can only have a value if \"category\" is \"CUSTOM\"." + }, + "created_at": { + "type": "string", + "format": "date-time", + "readOnly": true, + "example": "2019-02-01 11:16:52" + }, + "customer_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "description": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "document_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "end_at": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "example": null, + "description": "The deadline" + }, + "finish_at": { + "type": "string", + "format": "date-time", + "readOnly": true, + "x-nullable": true, + "example": null, + "description": "The time when the task was marked as done" + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "login_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "example": null, + "description": "When omitted or null, the currently active login is used" + }, + "name": { + "type": "string", + "example": "Call client" + }, + "position_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "priority": { + "type": "string", + "enum": [ + "LOW", + "NORMAL", + "HIGH" + ], + "default": "NORMAL" + }, + "project_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "start_at": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "default": null, + "example": null + }, + "status": { + "type": "string", + "enum": [ + "WAITING", + "PROCESSING", + "DONE", + "CANCEL" + ], + "example": "PROCESSING" + }, + "status_percent": { + "type": "integer", + "x-nullable": true, + "default": null, + "example": 50 + } + } + }, + "Tasks": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Task" + } + } + } + } + ] + }, + "Project": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "budget_amount": { + "type": "integer", + "description": "Project budget in cents (e.g. \"150\" = 1.50€)", + "default": 0, + "example": 10000 + }, + "budget_time": { + "type": "integer", + "description": "Time budget in minutes (e.g. \"90\" = 1 hour and 30 minutes)", + "default": 0, + "example": 60 + }, + "customer_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null + }, + "hourly_rate": { + "type": "number", + "format": "float", + "description": "Hourly rate in cents (e.g. \"150\" = 1.50€)", + "example": 3000 + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "login_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "example": null, + "description": "If omitted or null, the currently active login is used" + }, + "name": { + "type": "string", + "example": "My Project" + }, + "note": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "status": { + "type": "string", + "enum": [ + "OPEN", + "DONE", + "CANCEL" + ], + "default": "OPEN" + }, + "due_at": { + "type": "string", + "format": "date", + "x-nullable": true, + "default": null, + "example": null + }, + "budget_notify_frequency": { + "type": "string", + "enum": [ + "ALWAYS", + "ONCE", + "NEVER" + ], + "default": "ALWAYS" + }, + "consumed_time": { + "type": "integer", + "readOnly": true + }, + "consumed_amount": { + "type": "integer", + "readOnly": true + } + } + }, + "Projects": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Project" + } + } + } + } + ] + }, + "Position": { + "type": "object", + "required": [ + "number", + "description", + "sale_price" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "type": { + "type": "string", + "enum": [ + "PRODUCT", + "SERVICE", + "TEXT" + ], + "default": "PRODUCT" + }, + "number": { + "type": "string", + "example": 1234 + }, + "description": { + "type": "string", + "example": "iPhone X", + "description": "The positions name or description" + }, + "document_note": { + "type": "string", + "example": "Test Note", + "description": "This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction." + }, + "note": { + "type": "string", + "example": null, + "description": "Note for internal use", + "x-nullable": true, + "default": null + }, + "unit": { + "type": "string", + "example": null, + "x-nullable": true, + "default": null + }, + "export_identifier": { + "type": "string", + "x-nullable": true, + "default": null, + "example": "8400", + "description": "The FAS-Account is the four-digit revenue account, in which the revenue will be entered when doing the export to your tax consultant. In case you want to split your revenue to several revenue accounts, please talk to your tax consultant before, to guarantee an unobstructed use of the interface. For every revenue element, there are number ranges, which can be used. Please avoid using combinations of numbers, which can not be used by your tax consultant." + }, + "export_identifier_extended": { + "$ref": "#/definitions/PositionExportIdentifierExtended" + }, + "login_id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "price_type": { + "type": "string", + "enum": [ + "BRUTTO", + "NETTO" + ], + "default": "NETTO" + }, + "vat_percent": { + "type": "number", + "format": "float", + "default": 19, + "example": 19 + }, + "sale_price": { + "type": "number", + "format": "float", + "example": 1250, + "description": "Price in cents (e.g. \"150\" = 1.50€)" + }, + "sale_price2": { + "type": "number", + "format": "float", + "description": "Price for customers of group 2 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price3": { + "type": "number", + "format": "float", + "description": "Price for customers of group 3 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price4": { + "type": "number", + "format": "float", + "description": "Price for customers of group 4 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price5": { + "type": "number", + "format": "float", + "description": "Price for customers of group 5 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price6": { + "type": "number", + "format": "float", + "description": "Price for customers of group 6 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price7": { + "type": "number", + "format": "float", + "description": "Price for customers of group 7 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price8": { + "type": "number", + "format": "float", + "description": "Price for customers of group 8 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price9": { + "type": "number", + "format": "float", + "description": "Price for customers of group 9 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "sale_price10": { + "type": "number", + "format": "float", + "description": "Price for customers of group 10 in cents (e.g. \"150\" = 1.50€)", + "x-nullable": true, + "default": null, + "example": null + }, + "cost_price": { + "type": "number", + "format": "float", + "example": 830, + "x-nullable": true, + "description": "Price in cents (e.g. \"150\" = 1.50€)" + }, + "export_cost1": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "export_cost2": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "group_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "example": null + }, + "stock": { + "type": "string", + "enum": [ + "YES", + "NO" + ], + "description": "Activates stock management for this position", + "default": "NO" + }, + "stock_count": { + "type": "integer", + "example": 100, + "default": 0, + "description": "Current stock count", + "readOnly": true + }, + "stock_limit_notify": { + "type": "boolean", + "default": false, + "description": "Notify when stock_count is lower than stock_limit" + }, + "stock_limit_notify_frequency": { + "type": "string", + "enum": [ + "ALWAYS", + "ONCE" + ], + "default": "ALWAYS", + "description": "Notify frequency when stock_count is lower than stock_limit (ALWAYS, ONCE)" + }, + "stock_limit": { + "type": "integer", + "example": 50, + "default": 0 + }, + "quantity": { + "type": "number", + "format": "float", + "description": "Used as the default quantity when adding this position to a document", + "example": 10, + "x-nullable": true, + "default": null + }, + "archived": { + "type": "boolean", + "example": false, + "default": false + } + } + }, + "Positions": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Position" + } + } + } + } + ] + }, + "PositionExportIdentifierExtended": { + "type": "object", + "properties": { + "NULL": { + "type": "string", + "example": "8400", + "description": "Umsatzsteuerpflichtig", + "x-nullable": true, + "default": null + }, + "nStb": { + "type": "string", + "example": "8338", + "description": "Nicht steuerbar (Drittland)", + "x-nullable": true, + "default": null + }, + "nStbUstID": { + "type": "string", + "example": "8339", + "description": "Nicht steuerbar (EU mit USt-IdNr.)", + "x-nullable": true, + "default": null + }, + "nStbNoneUstID": { + "type": "string", + "example": "8950", + "description": "Nicht steuerbar (EU ohne USt-IdNr.)", + "x-nullable": true, + "default": null + }, + "nStbIm": { + "type": "string", + "example": "8950", + "description": "Nicht steuerbarer Innenumsatz", + "x-nullable": true, + "default": null + }, + "revc": { + "type": "string", + "example": "8337", + "description": "Steuerschuldwechsel §13b (Inland)", + "x-nullable": true, + "default": null + }, + "IG": { + "type": "string", + "example": "8125", + "description": "Innergemeinschaftliche Lieferung", + "x-nullable": true, + "default": null + }, + "AL": { + "type": "string", + "example": "8120", + "description": "Ausfuhrlieferung", + "x-nullable": true, + "default": null + }, + "sStfr": { + "type": "string", + "example": "8100", + "description": "sonstige Steuerbefreiung", + "x-nullable": true, + "default": null + }, + "smallBusiness": { + "type": "string", + "example": "8195", + "description": "Kleinunternehmen (Keine MwSt.)", + "x-nullable": true, + "default": null + } + } + }, + "PositionGroup": { + "type": "object", + "required": [ + "number", + "name" + ], + "properties": { + "description": { + "type": "string", + "example": null, + "x-nullable": true, + "default": null + }, + "login_id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "name": { + "type": "string", + "example": "Mobile Phones" + }, + "number": { + "type": "string", + "example": "001" + }, + "display_name": { + "type": "string", + "readOnly": true, + "example": "001 - Mobile Phones" + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + } + } + }, + "PositionGroups": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/PositionGroup" + } + } + } + } + ] + }, + "TimeTracking": { + "type": "object", + "required": [ + "description" + ], + "properties": { + "cleared_at": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "default": null, + "example": null + }, + "created_at": { + "type": "string", + "format": "date-time", + "readOnly": true, + "example": "2019-02-01 11:16:52" + }, + "date_from_at": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "default": null, + "example": "2019-02-05 11:30:00" + }, + "date_thru_at": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "default": null, + "example": "2019-02-05 13:00:00" + }, + "description": { + "type": "string", + "example": "Meeting with client" + }, + "hourly_rate": { + "type": "number", + "format": "float", + "default": 0, + "description": "Hourly rate in cents (e.g. \"150\" = 1.50€)", + "example": 2000 + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "note": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null + }, + "number": { + "type": "string", + "x-nullable": true, + "example": "001", + "description": "Can be chosen freely" + }, + "position_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "project_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "login_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "description": "If omitted or null, the currently active login is used.", + "example": null + }, + "timer_value": { + "type": "integer", + "x-nullable": true, + "default": null, + "description": "Tracked time in minutes", + "example": 90 + } + } + }, + "TimeTrackings": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/TimeTracking" + } + } + } + } + ] + }, + "TextTemplate": { + "type": "object", + "required": [ + "title", + "text" + ], + "properties": { + "can_modify": { + "type": "boolean", + "readOnly": true, + "description": "Deprecated, field is always true." + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "text": { + "type": "string", + "example": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." + }, + "title": { + "type": "string", + "example": "Lorem Ipsum" + } + } + }, + "TextTemplates": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/TextTemplate" + } + } + } + } + ] + }, + "Attachment": { + "type": "object", + "description": "If customer_id, project_id and document_id are null, the attachment has a global context and is accessible from the web ui. Keep in mind only to provide one of the four context. You can't attach a file to several context in one request. A error is thrown if you provide two or more context (i. E. sending customer_id, document_id and project_id in combination).", + "properties": { + "created_at": { + "type": "string", + "format": "date", + "readOnly": true + }, + "customer_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "document_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "file_name": { + "type": "string", + "example": "my_doc.pdf", + "readOnly": true + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "project_id": { + "type": "integer", + "format": "int64", + "x-nullable": true, + "default": null, + "example": null + }, + "size": { + "type": "integer", + "example": 10022, + "description": "In byte", + "readOnly": true + } + } + }, + "Attachments": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Attachment" + } + } + } + } + ] + }, + "DocumentPayment": { + "type": "object", + "required": [ + "document_id", + "amount" + ], + "properties": { + "amount": { + "type": "integer", + "format": "int32" + }, + "document_id": { + "type": "integer", + "format": "int64" + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "is_overdue_fee": { + "type": "boolean" + }, + "login_id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "notice": { + "type": "string", + "default": "" + }, + "payment_at": { + "type": "string", + "format": "date" + }, + "type": { + "type": "string", + "maxLength": 255, + "default": "" + }, + "provider": { + "type": "string", + "maxLength": 255, + "default": "" + }, + "reference": { + "type": "string", + "maxLength": 255, + "default": "" + } + }, + "example": { + "id": 1, + "document_id": 1, + "login_id": 1, + "amount": 1000, + "payment_at": "2007-09-17T00:00:00.000Z", + "type": "VISA", + "provider": "Stripe", + "reference": "111111-VISA-222222-6666" + } + }, + "DocumentPayments": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/DocumentPayment" + } + } + } + } + ] + }, + "PostBoxRequest": { + "type": "object", + "properties": { + "to": { + "type": "string" + }, + "cc": { + "type": "string" + }, + "from": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "message": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date" + }, + "send_by_self": { + "type": "boolean", + "example": "false" + }, + "send_with_attachment": { + "type": "boolean", + "default": "true", + "example": "true" + }, + "document_file_type": { + "type": "string", + "enum": [ + "default", + "zugferd1", + "zugferd2_2", + "zugferd2_4_en16931", + "zugferd2_4_extended", + "xrechnung", + "xrechnung_xml", + "xrechnung2_2_xml", + "xrechnung3_0_xml" + ], + "x-nullable": true, + "description": "When set to null, the setting on the customer is used" + }, + "post_send_type": { + "type": "string", + "example": "post_send_type_standard", + "description": "This value indicates what method is used when the document is send via mail.\nThe different types are offered by the german post as additional services.\nThe registered mail options will include a tracking number which will be \nadded to the postbox when known.\n\nIf the value is omitted or empty when a postbox is created with the type \"POST\"\npost_send_type_standard will be used.\n\nFor postbox with a different type than \"POST\" this field will hold a empty string.\n", + "enum": [ + "post_send_type_standard", + "post_send_type_registered", + "post_send_type_registered_and_personal", + "post_send_type_registered_and_receipt", + "post_send_type_registered_throwin" + ] + } + } + }, + "PostBox": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "document_id": { + "type": "integer", + "format": "int64" + }, + "to": { + "type": "string", + "example": "example@easybill.de" + }, + "cc": { + "type": "string", + "example": null + }, + "from": { + "type": "string", + "example": "example@easybill.de" + }, + "subject": { + "type": "string", + "example": "Invoice" + }, + "message": { + "type": "string", + "example": "Dear Mr. ..." + }, + "date": { + "type": "string", + "format": "date", + "example": "2019-02-07" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2019-02-07 11:29:28" + }, + "processed_at": { + "type": "string", + "format": "date-time", + "example": null + }, + "send_by_self": { + "type": "boolean", + "example": false + }, + "send_with_attachment": { + "type": "boolean", + "example": true + }, + "type": { + "type": "string", + "enum": [ + "FAX", + "EMAIL", + "POST" + ], + "example": "EMAIL" + }, + "status": { + "type": "string", + "enum": [ + "WAITING", + "PREPARE", + "ERROR", + "OK", + "PROCESSING" + ] + }, + "status_msg": { + "type": "string", + "example": null + }, + "login_id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "document_file_type": { + "type": "string", + "enum": [ + "default", + "zugferd1", + "zugferd2_2", + "zugferd2_4_en16931", + "zugferd2_4_extended", + "xrechnung", + "xrechnung_xml" + ], + "x-nullable": true + }, + "post_send_type": { + "type": "string", + "example": "post_send_type_standard", + "description": "This value indicates what method is used when the document is send via mail.\nThe different types are offered by the german post as additional services.\nThe registered mail options will include a tracking number which will be \nadded to the postbox when known.\n\nIf the value is omitted or empty when a postbox is created with the type \"POST\"\npost_send_type_standard will be used.\n\nFor postbox with a different type than \"POST\" this field will hold a empty string.\n", + "enum": [ + "post_send_type_standard", + "post_send_type_registered", + "post_send_type_registered_and_personal", + "post_send_type_registered_and_receipt", + "post_send_type_registered_throwin", + "post_send_type_prio" + ] + }, + "tracking_identifier": { + "readOnly": true, + "type": "string", + "example": "DE1234567890", + "description": "If the document is send with one of the registered send types stated for post_send_type, a tracking identifier\nwill be added to the postbox at a later point when the tracking identifier is provided\nby our service partner.\n" + } + } + }, + "PostBoxes": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/PostBox" + } + } + } + } + ] + }, + "SEPAPayment": { + "type": "object", + "required": [ + "document_id", + "debitor_name", + "debitor_iban", + "mandate_id", + "mandate_date_of_signature", + "local_instrument", + "sequence_type", + "amount", + "reference" + ], + "properties": { + "amount": { + "type": "integer", + "description": "Amount in cents (e.g. \"150\" = 1.50€)", + "example": 10000 + }, + "created_at": { + "type": "string", + "format": "date-time", + "readOnly": true, + "example": "2019-02-01 11:16:52" + }, + "creditor_bic": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null, + "description": "If type is DEBIT, this field is overwritten with the selected bank account data on export." + }, + "creditor_iban": { + "type": "string", + "x-nullable": true, + "example": "DE12345678901234567890", + "description": "Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export." + }, + "creditor_name": { + "type": "string", + "x-nullable": true, + "example": "Easybill GmbH", + "description": "Mandatory if type is CREDIT. If type is DEBIT, this field is overwritten with the selected bank account data on export." + }, + "debitor_bic": { + "type": "string", + "x-nullable": true, + "default": null, + "example": null, + "description": "If type is CREDIT, this field is overwritten with the selected bank account data on export." + }, + "debitor_iban": { + "type": "string", + "x-nullable": true, + "example": "DE12345678901234567890", + "description": "Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export." + }, + "debitor_name": { + "type": "string", + "x-nullable": true, + "example": "Easybill GmbH", + "description": "Mandatory if type is DEBIT. If type is CREDIT, this field is overwritten with the selected bank account data on export." + }, + "debitor_address_line_1": { + "type": "string", + "maxLength": 70, + "example": "Bahnhofstr. 1", + "description": "Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA" + }, + "debitor_address_line2": { + "type": "string", + "maxLength": 70, + "example": "8001 Zürich", + "description": "string" + }, + "debitor_country": { + "type": "string", + "maxLength": 2, + "example": "CH", + "description": "Mandatory if type is DEBIT and the debitor's IBAN belongs to a country outside the EEA" + }, + "document_id": { + "type": "integer", + "format": "int64" + }, + "export_at": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "default": null, + "description": "If a date is set, this record is marked as exported", + "example": null + }, + "export_error": { + "type": "string", + "example": null, + "readOnly": true + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "local_instrument": { + "type": "string", + "enum": [ + "CORE", + "COR1", + "B2B" + ], + "description": "CORE: SEPA Core Direct Debit
COR1: SEPA-Basislastschrift COR1 (deprecated use CORE instead)
B2B: SEPA Business to Business Direct Debit" + }, + "mandate_date_of_signature": { + "type": "string", + "format": "date", + "example": "2019-02-01" + }, + "mandate_id": { + "type": "string", + "maxLength": 34, + "example": "001" + }, + "reference": { + "type": "string", + "maxLength": 35, + "example": "X000000001" + }, + "remittance_information": { + "type": "string", + "maxLength": 140, + "x-nullable": true, + "default": null, + "example": null + }, + "requested_at": { + "type": "string", + "format": "date", + "default": "now", + "description": "Booking date" + }, + "sequence_type": { + "type": "string", + "enum": [ + "FRST", + "OOFF", + "FNAL", + "RCUR" + ], + "description": "FRST: Erstlastschrift
RCUR: Folgelastschrift
OOFF: Einmallastschrift
FNAL: Letztmalige Lastschrift" + }, + "updated_at": { + "example": "2018-01-01 23:23:45", + "type": "string", + "format": "datetime", + "readOnly": true + }, + "type": { + "type": "string", + "enum": [ + "DEBIT", + "CREDIT" + ], + "default": "DEBIT" + } + } + }, + "SEPAPayments": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/SEPAPayment" + } + } + } + } + ] + }, + "WebHook": { + "type": "object", + "required": [ + "url", + "content_type", + "secret", + "events", + "description" + ], + "properties": { + "content_type": { + "type": "string", + "enum": [ + "form", + "json" + ] + }, + "description": { + "type": "string", + "example": "My Webhook" + }, + "events": { + "type": "array", + "items": { + "type": "string", + "uniqueItems": true, + "enum": [ + "document.create", + "document.update", + "document.completed", + "document.deleted", + "document.payment_add", + "document.payment_delete", + "customer.create", + "customer.update", + "customer.delete", + "contact.create", + "contact.update", + "contact.delete", + "position.create", + "position.update", + "position.delete", + "postbox.create", + "postbox.update", + "postbox.delete", + "postbox.sent" + ] + } + }, + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "is_active": { + "type": "boolean", + "default": false + }, + "last_response": { + "$ref": "#/definitions/WebHookLastResponse" + }, + "secret": { + "type": "string", + "example": "" + }, + "url": { + "type": "string", + "example": "https://..." + } + } + }, + "WebHooks": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/WebHook" + } + } + } + } + ] + }, + "WebHookLastResponse": { + "type": "object", + "readOnly": true, + "properties": { + "date": { + "type": "string", + "format": "date-time", + "readOnly": true, + "example": "2019-02-01 11:16:52" + }, + "code": { + "type": "integer", + "readOnly": true, + "example": 204 + }, + "response": { + "type": "string", + "readOnly": true, + "example": "" + } + } + }, + "PDFTemplate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "default": "INVOICE-DE", + "example": "INVOICE-DE" + }, + "name": { + "type": "string", + "default": "Default template", + "example": "Default template" + }, + "pdf_template": { + "type": "string", + "default": "DE", + "example": "DE" + }, + "document_type": { + "type": "string", + "default": "INVOICE", + "example": "INVOICE" + }, + "settings": { + "type": "object", + "properties": { + "text_prefix": { + "type": "string", + "default": "", + "example": "" + }, + "text": { + "type": "string", + "default": "", + "example": "" + }, + "email": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "default": "", + "example": "" + }, + "message": { + "type": "string", + "default": "", + "example": "" + } + } + } + } + } + } + }, + "PDFTemplates": { + "type": "object", + "allOf": [ + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/PDFTemplate" + } + } + } + } + ] + }, + "Discount": { + "type": "object", + "required": [ + "customer_id" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "customer_id": { + "type": "integer", + "format": "int64" + }, + "discount": { + "type": "integer", + "default": 0, + "example": 10, + "description": "The discount value depending on \"discount_type\". If not provided, inherits from customer when available" + }, + "discount_type": { + "type": "string", + "default": "PERCENT", + "enum": [ + "AMOUNT", + "PERCENT", + "QUANTITY", + "FIX" + ], + "description": "AMOUNT subtracts the value in \"discount\" from the total
QUANTITY subtracts the value in \"discount\" multiplied by quantity
PERCENT uses the value in \"discount\" as a percentage
FIX sets the value in \"discount\" as the new price. If not provided, inherits from customer when available" + } + } + }, + "DiscountPosition": { + "type": "object", + "required": [ + "position_id" + ], + "properties": { + "position_id": { + "type": "integer", + "format": "int64" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Discount" + } + ] + }, + "DiscountPositions": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/DiscountPosition" + } + } + } + } + ] + }, + "DiscountPositionGroup": { + "type": "object", + "required": [ + "position_group_id" + ], + "properties": { + "position_group_id": { + "type": "integer", + "format": "int64" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Discount" + } + ] + }, + "DiscountPositionGroups": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/DiscountPositionGroup" + } + } + } + } + ] + }, + "Login": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "first_name": { + "type": "string", + "example": "Max" + }, + "last_name": { + "type": "string", + "example": "Musterfrau" + }, + "display_name": { + "type": "string", + "readOnly": true, + "example": "Max Musterfrau" + }, + "phone": { + "type": "string", + "example": "+4923489342" + }, + "email": { + "type": "string", + "example": "example@easybill.de" + }, + "email_signature": { + "type": "string", + "example": null + }, + "login_type": { + "type": "string", + "default": "ASSISTANT", + "enum": [ + "ADMIN", + "ASSISTANT" + ] + }, + "locale": { + "type": "string", + "example": "de" + }, + "time_zone": { + "type": "string", + "example": "Europe/Berlin" + }, + "security": { + "$ref": "#/definitions/LoginSecurity" + } + } + }, + "Logins": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Login" + } + } + } + } + ] + }, + "SerialNumber": { + "type": "object", + "required": [ + "serial_number", + "position_id" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "serial_number": { + "example": "DHEZ-DHSNR-2344D-FFW", + "type": "string" + }, + "position_id": { + "type": "integer", + "format": "int6" + }, + "document_id": { + "example": null, + "x-nullable": true, + "type": "integer", + "format": "int64", + "readOnly": true + }, + "document_position_id": { + "example": null, + "x-nullable": true, + "type": "integer", + "format": "int64", + "readOnly": true + }, + "used_at": { + "example": null, + "x-nullable": true, + "type": "string", + "format": "datetime", + "readOnly": true + }, + "created_at": { + "example": "2018-01-01 23:23:45", + "type": "string", + "format": "datetime", + "readOnly": true + } + } + }, + "SerialNumbers": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/SerialNumber" + } + } + } + } + ] + }, + "Stock": { + "type": "object", + "required": [ + "stock_count", + "position_id" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "note": { + "type": "string", + "example": "Correction for stock count of the Entry from 11/01/2017" + }, + "stock_count": { + "example": 666, + "type": "integer", + "format": "int64" + }, + "position_id": { + "type": "integer", + "format": "int64" + }, + "document_id": { + "example": null, + "x-nullable": true, + "type": "integer", + "format": "int64", + "readOnly": true + }, + "document_position_id": { + "example": null, + "x-nullable": true, + "type": "integer", + "format": "int64", + "readOnly": true + }, + "stored_at": { + "x-nullable": true, + "type": "string", + "format": "datetime", + "example": "2017-04-11 13:00:00" + }, + "created_at": { + "example": "2018-01-01 23:23:45", + "type": "string", + "format": "datetime", + "readOnly": true + }, + "updated_at": { + "example": "2018-01-01 23:23:45", + "type": "string", + "format": "datetime", + "readOnly": true + } + } + }, + "Stocks": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/List" + }, + { + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Stock" + } + } + } + } + ] + }, + "LoginSecurity": { + "type": "object", + "description": "This object is only displayed if your request the login resource as an admin. Otherwise this property will be null.", + "properties": { + "two_factor_enabled": { + "type": "boolean", + "readOnly": true, + "default": false, + "description": "Shows if the login has two factor enabled for the login process" + }, + "recovery_codes_enabled": { + "type": "boolean", + "readOnly": true, + "default": false, + "description": "Shows if the login has recovery codes enabled to bypass two factor" + }, + "notify_on_new_login_enabled": { + "type": "boolean", + "readOnly": true, + "default": true, + "description": "Shows if the login has enabled to be notified if a new login is made from an unknown device." + } + } + } + } +} diff --git a/tests/test_auth.py b/tests/test_auth.py new file mode 100644 index 0000000..9fdb07b --- /dev/null +++ b/tests/test_auth.py @@ -0,0 +1,10 @@ +from easybill_client.auth import basic_auth_header, bearer_auth_header + + +def test_bearer_auth_header(): + assert bearer_auth_header("abc123") == {"Authorization": "Bearer abc123"} + + +def test_basic_auth_header(): + header = basic_auth_header("user@example.com", "apikey") + assert header["Authorization"].startswith("Basic ") diff --git a/tests/test_webhooks.py b/tests/test_webhooks.py new file mode 100644 index 0000000..b81addc --- /dev/null +++ b/tests/test_webhooks.py @@ -0,0 +1,58 @@ +from easybill_client.webhooks import EasybillWebhookParser + + +def test_parser_reads_headers_and_payload(): + parser = EasybillWebhookParser(secret="topsecret") + + payload = {"id": 42, "number": "RE-42"} + headers = { + "X-easybill-Event": "document.completed", + "X-easybill-Webhook-Delivery": "4711", + } + + envelope = parser.parse_json(headers=headers, payload=payload) + + assert envelope.event == "document.completed" + assert envelope.delivery_id == "4711" + assert envelope.resource_id == 42 + assert envelope.payload == payload + + +def test_parser_supports_form_encoded_payload(): + parser = EasybillWebhookParser() + + headers = { + "X-easybill-Event": "customer.update", + "X-easybill-Webhook-Delivery": "99", + } + form_data = { + "id": "15", + "customer_id": "15", + "company_name": "ACME GmbH", + } + + envelope = parser.parse_form(headers=headers, form_data=form_data) + + assert envelope.event == "customer.update" + assert envelope.delivery_id == "99" + assert envelope.resource_id == 15 + assert envelope.payload["company_name"] == "ACME GmbH" + + +def test_generic_parse_and_acknowledgement(): + parser = EasybillWebhookParser() + + headers = { + "X-easybill-Event": "document.completed", + "X-easybill-Webhook-Delivery": "123", + } + + envelope = parser.parse( + headers=headers, + payload={"id": 7, "status": "done"}, + content_type="application/json", + ) + + assert envelope.event == "document.completed" + assert envelope.resource_id == 7 + assert parser.build_acknowledgement() == {"status": "ok"}