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.
This commit is contained in:
commit
caacb339dd
550 changed files with 127217 additions and 0 deletions
208
generated/async/easybill_generated_async/__init__.py
Normal file
208
generated/async/easybill_generated_async/__init__.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
25
generated/async/easybill_generated_async/api/__init__.py
Normal file
25
generated/async/easybill_generated_async/api/__init__.py
Normal file
|
|
@ -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
|
||||
|
||||
1673
generated/async/easybill_generated_async/api/attachment_api.py
Normal file
1673
generated/async/easybill_generated_async/api/attachment_api.py
Normal file
File diff suppressed because it is too large
Load diff
1489
generated/async/easybill_generated_async/api/contact_api.py
Normal file
1489
generated/async/easybill_generated_async/api/contact_api.py
Normal file
File diff suppressed because it is too large
Load diff
1618
generated/async/easybill_generated_async/api/customer_api.py
Normal file
1618
generated/async/easybill_generated_async/api/customer_api.py
Normal file
File diff suppressed because it is too large
Load diff
1411
generated/async/easybill_generated_async/api/customer_group_api.py
Normal file
1411
generated/async/easybill_generated_async/api/customer_group_api.py
Normal file
File diff suppressed because it is too large
Load diff
2887
generated/async/easybill_generated_async/api/discount_api.py
Normal file
2887
generated/async/easybill_generated_async/api/discount_api.py
Normal file
File diff suppressed because it is too large
Load diff
3740
generated/async/easybill_generated_async/api/document_api.py
Normal file
3740
generated/async/easybill_generated_async/api/document_api.py
Normal file
File diff suppressed because it is too large
Load diff
1186
generated/async/easybill_generated_async/api/document_payment_api.py
Normal file
1186
generated/async/easybill_generated_async/api/document_payment_api.py
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
)
|
||||
|
||||
|
||||
582
generated/async/easybill_generated_async/api/logins_api.py
Normal file
582
generated/async/easybill_generated_async/api/logins_api.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
)
|
||||
|
||||
|
||||
1445
generated/async/easybill_generated_async/api/position_api.py
Normal file
1445
generated/async/easybill_generated_async/api/position_api.py
Normal file
File diff suppressed because it is too large
Load diff
1411
generated/async/easybill_generated_async/api/position_group_api.py
Normal file
1411
generated/async/easybill_generated_async/api/position_group_api.py
Normal file
File diff suppressed because it is too large
Load diff
894
generated/async/easybill_generated_async/api/post_box_api.py
Normal file
894
generated/async/easybill_generated_async/api/post_box_api.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
)
|
||||
|
||||
|
||||
1445
generated/async/easybill_generated_async/api/project_api.py
Normal file
1445
generated/async/easybill_generated_async/api/project_api.py
Normal file
File diff suppressed because it is too large
Load diff
1428
generated/async/easybill_generated_async/api/sepa_payment_api.py
Normal file
1428
generated/async/easybill_generated_async/api/sepa_payment_api.py
Normal file
File diff suppressed because it is too large
Load diff
1175
generated/async/easybill_generated_async/api/serial_number_api.py
Normal file
1175
generated/async/easybill_generated_async/api/serial_number_api.py
Normal file
File diff suppressed because it is too large
Load diff
897
generated/async/easybill_generated_async/api/stock_api.py
Normal file
897
generated/async/easybill_generated_async/api/stock_api.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
)
|
||||
|
||||
|
||||
1411
generated/async/easybill_generated_async/api/task_api.py
Normal file
1411
generated/async/easybill_generated_async/api/task_api.py
Normal file
File diff suppressed because it is too large
Load diff
1411
generated/async/easybill_generated_async/api/text_template_api.py
Normal file
1411
generated/async/easybill_generated_async/api/text_template_api.py
Normal file
File diff suppressed because it is too large
Load diff
1479
generated/async/easybill_generated_async/api/time_tracking_api.py
Normal file
1479
generated/async/easybill_generated_async/api/time_tracking_api.py
Normal file
File diff suppressed because it is too large
Load diff
1411
generated/async/easybill_generated_async/api/webhook_api.py
Normal file
1411
generated/async/easybill_generated_async/api/webhook_api.py
Normal file
File diff suppressed because it is too large
Load diff
811
generated/async/easybill_generated_async/api_client.py
Normal file
811
generated/async/easybill_generated_async/api_client.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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)
|
||||
21
generated/async/easybill_generated_async/api_response.py
Normal file
21
generated/async/easybill_generated_async/api_response.py
Normal file
|
|
@ -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
|
||||
}
|
||||
648
generated/async/easybill_generated_async/configuration.py
Normal file
648
generated/async/easybill_generated_async/configuration.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
218
generated/async/easybill_generated_async/exceptions.py
Normal file
218
generated/async/easybill_generated_async/exceptions.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
76
generated/async/easybill_generated_async/models/__init__.py
Normal file
76
generated/async/easybill_generated_async/models/__init__.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
124
generated/async/easybill_generated_async/models/attachment.py
Normal file
124
generated/async/easybill_generated_async/models/attachment.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
104
generated/async/easybill_generated_async/models/attachments.py
Normal file
104
generated/async/easybill_generated_async/models/attachments.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
207
generated/async/easybill_generated_async/models/contact.py
Normal file
207
generated/async/easybill_generated_async/models/contact.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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<br/> 1: Herrn<br/> 2: Frau<br/> 3: Firma<br/> 4: Herrn und Frau<br/> 5: Eheleute<br/> 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
|
||||
|
||||
|
||||
104
generated/async/easybill_generated_async/models/contacts.py
Normal file
104
generated/async/easybill_generated_async/models/contacts.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
577
generated/async/easybill_generated_async/models/customer.py
Normal file
577
generated/async/easybill_generated_async/models/customer.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
104
generated/async/easybill_generated_async/models/customers.py
Normal file
104
generated/async/easybill_generated_async/models/customers.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
106
generated/async/easybill_generated_async/models/discount.py
Normal file
106
generated/async/easybill_generated_async/models/discount.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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<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")
|
||||
__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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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<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")
|
||||
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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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<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")
|
||||
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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
491
generated/async/easybill_generated_async/models/document.py
Normal file
491
generated/async/easybill_generated_async/models/document.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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<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.)")
|
||||
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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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<br/> 1: Herrn<br/> 2: Frau<br/> 3: Firma<br/> 4: Herrn und Frau<br/> 5: Eheleute<br/> 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
104
generated/async/easybill_generated_async/models/documents.py
Normal file
104
generated/async/easybill_generated_async/models/documents.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
94
generated/async/easybill_generated_async/models/list.py
Normal file
94
generated/async/easybill_generated_async/models/list.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
126
generated/async/easybill_generated_async/models/login.py
Normal file
126
generated/async/easybill_generated_async/models/login.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
104
generated/async/easybill_generated_async/models/logins.py
Normal file
104
generated/async/easybill_generated_async/models/logins.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
100
generated/async/easybill_generated_async/models/pdf_template.py
Normal file
100
generated/async/easybill_generated_async/models/pdf_template.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
287
generated/async/easybill_generated_async/models/position.py
Normal file
287
generated/async/easybill_generated_async/models/position.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
104
generated/async/easybill_generated_async/models/positions.py
Normal file
104
generated/async/easybill_generated_async/models/positions.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
176
generated/async/easybill_generated_async/models/post_box.py
Normal file
176
generated/async/easybill_generated_async/models/post_box.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
104
generated/async/easybill_generated_async/models/post_boxes.py
Normal file
104
generated/async/easybill_generated_async/models/post_boxes.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
159
generated/async/easybill_generated_async/models/project.py
Normal file
159
generated/async/easybill_generated_async/models/project.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
104
generated/async/easybill_generated_async/models/projects.py
Normal file
104
generated/async/easybill_generated_async/models/projects.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
208
generated/async/easybill_generated_async/models/sepa_payment.py
Normal file
208
generated/async/easybill_generated_async/models/sepa_payment.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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<br/> COR1: SEPA-Basislastschrift COR1 (deprecated use CORE instead)<br/> 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<br/> RCUR: Folgelastschrift<br/> OOFF: Einmallastschrift<br/> 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
|
||||
|
||||
|
||||
104
generated/async/easybill_generated_async/models/sepa_payments.py
Normal file
104
generated/async/easybill_generated_async/models/sepa_payments.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
125
generated/async/easybill_generated_async/models/serial_number.py
Normal file
125
generated/async/easybill_generated_async/models/serial_number.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
127
generated/async/easybill_generated_async/models/service_date.py
Normal file
127
generated/async/easybill_generated_async/models/service_date.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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'.<br/> 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
|
||||
|
||||
|
||||
129
generated/async/easybill_generated_async/models/stock.py
Normal file
129
generated/async/easybill_generated_async/models/stock.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
104
generated/async/easybill_generated_async/models/stocks.py
Normal file
104
generated/async/easybill_generated_async/models/stocks.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
214
generated/async/easybill_generated_async/models/task.py
Normal file
214
generated/async/easybill_generated_async/models/task.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
104
generated/async/easybill_generated_async/models/tasks.py
Normal file
104
generated/async/easybill_generated_async/models/tasks.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
162
generated/async/easybill_generated_async/models/time_tracking.py
Normal file
162
generated/async/easybill_generated_async/models/time_tracking.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
123
generated/async/easybill_generated_async/models/web_hook.py
Normal file
123
generated/async/easybill_generated_async/models/web_hook.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
104
generated/async/easybill_generated_async/models/web_hooks.py
Normal file
104
generated/async/easybill_generated_async/models/web_hooks.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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
|
||||
|
||||
|
||||
0
generated/async/easybill_generated_async/py.typed
Normal file
0
generated/async/easybill_generated_async/py.typed
Normal file
226
generated/async/easybill_generated_async/rest.py
Normal file
226
generated/async/easybill_generated_async/rest.py
Normal file
|
|
@ -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('<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.
|
||||
|
||||
The 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue