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
76
generated/sync/easybill_generated_sync/models/__init__.py
Normal file
76
generated/sync/easybill_generated_sync/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_sync.models.advanced_data_field import AdvancedDataField
|
||||
from easybill_generated_sync.models.attachment import Attachment
|
||||
from easybill_generated_sync.models.attachments import Attachments
|
||||
from easybill_generated_sync.models.contact import Contact
|
||||
from easybill_generated_sync.models.contacts import Contacts
|
||||
from easybill_generated_sync.models.customer import Customer
|
||||
from easybill_generated_sync.models.customer_group import CustomerGroup
|
||||
from easybill_generated_sync.models.customer_groups import CustomerGroups
|
||||
from easybill_generated_sync.models.customer_snapshot import CustomerSnapshot
|
||||
from easybill_generated_sync.models.customers import Customers
|
||||
from easybill_generated_sync.models.discount import Discount
|
||||
from easybill_generated_sync.models.discount_position import DiscountPosition
|
||||
from easybill_generated_sync.models.discount_position_group import DiscountPositionGroup
|
||||
from easybill_generated_sync.models.discount_position_groups import DiscountPositionGroups
|
||||
from easybill_generated_sync.models.discount_positions import DiscountPositions
|
||||
from easybill_generated_sync.models.document import Document
|
||||
from easybill_generated_sync.models.document_address import DocumentAddress
|
||||
from easybill_generated_sync.models.document_payment import DocumentPayment
|
||||
from easybill_generated_sync.models.document_payments import DocumentPayments
|
||||
from easybill_generated_sync.models.document_position import DocumentPosition
|
||||
from easybill_generated_sync.models.document_recurring import DocumentRecurring
|
||||
from easybill_generated_sync.models.document_version import DocumentVersion
|
||||
from easybill_generated_sync.models.document_version_item import DocumentVersionItem
|
||||
from easybill_generated_sync.models.document_versions import DocumentVersions
|
||||
from easybill_generated_sync.models.documents import Documents
|
||||
from easybill_generated_sync.models.file_format_config import FileFormatConfig
|
||||
from easybill_generated_sync.models.list import List
|
||||
from easybill_generated_sync.models.login import Login
|
||||
from easybill_generated_sync.models.login_security import LoginSecurity
|
||||
from easybill_generated_sync.models.logins import Logins
|
||||
from easybill_generated_sync.models.pdf_template import PDFTemplate
|
||||
from easybill_generated_sync.models.pdf_template_settings import PDFTemplateSettings
|
||||
from easybill_generated_sync.models.pdf_template_settings_email import PDFTemplateSettingsEmail
|
||||
from easybill_generated_sync.models.pdf_templates import PDFTemplates
|
||||
from easybill_generated_sync.models.position import Position
|
||||
from easybill_generated_sync.models.position_export_identifier_extended import PositionExportIdentifierExtended
|
||||
from easybill_generated_sync.models.position_group import PositionGroup
|
||||
from easybill_generated_sync.models.position_groups import PositionGroups
|
||||
from easybill_generated_sync.models.positions import Positions
|
||||
from easybill_generated_sync.models.post_box import PostBox
|
||||
from easybill_generated_sync.models.post_box_request import PostBoxRequest
|
||||
from easybill_generated_sync.models.post_boxes import PostBoxes
|
||||
from easybill_generated_sync.models.project import Project
|
||||
from easybill_generated_sync.models.projects import Projects
|
||||
from easybill_generated_sync.models.sepa_payment import SEPAPayment
|
||||
from easybill_generated_sync.models.sepa_payments import SEPAPayments
|
||||
from easybill_generated_sync.models.serial_number import SerialNumber
|
||||
from easybill_generated_sync.models.serial_numbers import SerialNumbers
|
||||
from easybill_generated_sync.models.service_date import ServiceDate
|
||||
from easybill_generated_sync.models.stock import Stock
|
||||
from easybill_generated_sync.models.stocks import Stocks
|
||||
from easybill_generated_sync.models.task import Task
|
||||
from easybill_generated_sync.models.tasks import Tasks
|
||||
from easybill_generated_sync.models.text_template import TextTemplate
|
||||
from easybill_generated_sync.models.text_templates import TextTemplates
|
||||
from easybill_generated_sync.models.time_tracking import TimeTracking
|
||||
from easybill_generated_sync.models.time_trackings import TimeTrackings
|
||||
from easybill_generated_sync.models.web_hook import WebHook
|
||||
from easybill_generated_sync.models.web_hook_last_response import WebHookLastResponse
|
||||
from easybill_generated_sync.models.web_hooks import WebHooks
|
||||
|
||||
|
|
@ -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/sync/easybill_generated_sync/models/attachment.py
Normal file
124
generated/sync/easybill_generated_sync/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/sync/easybill_generated_sync/models/attachments.py
Normal file
104
generated/sync/easybill_generated_sync/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_sync.models.attachment import Attachment
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class Attachments(BaseModel):
|
||||
"""
|
||||
Attachments
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[Attachment]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of Attachments from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of Attachments from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [Attachment.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
207
generated/sync/easybill_generated_sync/models/contact.py
Normal file
207
generated/sync/easybill_generated_sync/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/sync/easybill_generated_sync/models/contacts.py
Normal file
104
generated/sync/easybill_generated_sync/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_sync.models.contact import Contact
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class Contacts(BaseModel):
|
||||
"""
|
||||
Contacts
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[Contact]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of Contacts from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of Contacts from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [Contact.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
577
generated/sync/easybill_generated_sync/models/customer.py
Normal file
577
generated/sync/easybill_generated_sync/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
|
||||
|
||||
|
||||
105
generated/sync/easybill_generated_sync/models/customer_group.py
Normal file
105
generated/sync/easybill_generated_sync/models/customer_group.py
Normal file
|
|
@ -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
|
||||
|
||||
|
||||
104
generated/sync/easybill_generated_sync/models/customer_groups.py
Normal file
104
generated/sync/easybill_generated_sync/models/customer_groups.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_sync.models.customer_group import CustomerGroup
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class CustomerGroups(BaseModel):
|
||||
"""
|
||||
CustomerGroups
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[CustomerGroup]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of CustomerGroups from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of CustomerGroups from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [CustomerGroup.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
|
@ -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/sync/easybill_generated_sync/models/customers.py
Normal file
104
generated/sync/easybill_generated_sync/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_sync.models.customer import Customer
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class Customers(BaseModel):
|
||||
"""
|
||||
Customers
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[Customer]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of Customers from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of Customers from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [Customer.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
106
generated/sync/easybill_generated_sync/models/discount.py
Normal file
106
generated/sync/easybill_generated_sync/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_sync.models.discount_position_group import DiscountPositionGroup
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DiscountPositionGroups(BaseModel):
|
||||
"""
|
||||
DiscountPositionGroups
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[DiscountPositionGroup]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DiscountPositionGroups from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DiscountPositionGroups from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [DiscountPositionGroup.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
|
@ -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_sync.models.discount_position import DiscountPosition
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DiscountPositions(BaseModel):
|
||||
"""
|
||||
DiscountPositions
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[DiscountPosition]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DiscountPositions from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DiscountPositions from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [DiscountPosition.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
491
generated/sync/easybill_generated_sync/models/document.py
Normal file
491
generated/sync/easybill_generated_sync/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_sync.models.advanced_data_field import AdvancedDataField
|
||||
from easybill_generated_sync.models.customer_snapshot import CustomerSnapshot
|
||||
from easybill_generated_sync.models.document_address import DocumentAddress
|
||||
from easybill_generated_sync.models.document_position import DocumentPosition
|
||||
from easybill_generated_sync.models.document_recurring import DocumentRecurring
|
||||
from easybill_generated_sync.models.file_format_config import FileFormatConfig
|
||||
from easybill_generated_sync.models.service_date import ServiceDate
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class Document(BaseModel):
|
||||
"""
|
||||
Document
|
||||
""" # noqa: E501
|
||||
address: Optional[DocumentAddress] = None
|
||||
advanced_data_fields: Optional[List[AdvancedDataField]] = Field(default=None, description="EN16931 Business Terms (BT fields) for structured invoice data. On update the submitted list fully replaces the existing fields — send an empty array to clear all.")
|
||||
attachment_ids: Optional[List[StrictInt]] = None
|
||||
label_address: Optional[DocumentAddress] = None
|
||||
amount: Optional[StrictInt] = Field(default=None, description="Amount in cents (e.g. \"150\" = 1.50€)")
|
||||
amount_net: Optional[StrictInt] = Field(default=None, description="Amount in cents (e.g. \"150\" = 1.50€)")
|
||||
anonymize_due_date: Optional[date] = Field(default=None, description="A date which signals when to anonymize the document. Must be in the future. Turns into a read only field if the document is anonymized")
|
||||
anonymize_status: Optional[StrictStr] = Field(default='NOT_ANONYMIZED', description="This field signals if the document was anonymized")
|
||||
anonymized_at: Optional[StrictStr] = None
|
||||
bank_debit_form: Optional[StrictStr] = 'null'
|
||||
billing_country: Optional[StrictStr] = None
|
||||
calc_vat_from: Optional[StrictInt] = Field(default=None, description="0 === Net, 1 === Gross.")
|
||||
cancel_id: Optional[StrictInt] = Field(default=None, description="ID from the cancel document. Only for document type INVOICE.")
|
||||
cash_allowance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Cash allowance percentage. If not provided, inherits from customer when available.")
|
||||
cash_allowance_days: Optional[StrictInt] = Field(default=None, description="Days for cash allowance. If not provided, inherits from customer when available.")
|
||||
cash_allowance_text: Optional[StrictStr] = 'null'
|
||||
contact_id: Optional[StrictInt] = None
|
||||
contact_label: Optional[StrictStr] = ''
|
||||
contact_text: Optional[StrictStr] = ''
|
||||
created_at: Optional[datetime] = None
|
||||
currency: Optional[StrictStr] = 'EUR'
|
||||
customer_id: Optional[StrictInt] = None
|
||||
customer_snapshot: Optional[CustomerSnapshot] = None
|
||||
discount: Optional[StrictStr] = 'null'
|
||||
discount_type: Optional[StrictStr] = null
|
||||
document_date: Optional[date] = None
|
||||
due_date: Optional[date] = Field(default=None, description="To change the value use grace_period.")
|
||||
edited_at: Optional[datetime] = None
|
||||
external_id: Optional[StrictStr] = 'null'
|
||||
replica_url: Optional[StrictStr] = 'null'
|
||||
grace_period: Optional[StrictInt] = Field(default=None, description="will be replaced by its alias due_in_days.")
|
||||
due_in_days: Optional[StrictInt] = Field(default=None, description="due date in days. If not provided, inherits from customer when available")
|
||||
id: Optional[StrictInt] = None
|
||||
is_acceptable_on_public_domain: Optional[StrictBool] = Field(default=False, description="Indicates if a document can be accepted by the end customer through the document's public access page.")
|
||||
is_archive: Optional[StrictBool] = False
|
||||
is_draft: Optional[StrictBool] = Field(default=None, description="This property is read only. To finish the document call /documents/{id}/done.")
|
||||
is_replica: Optional[StrictBool] = Field(default=False, description="Marks a document as a replica from another software.")
|
||||
is_oss: Optional[StrictBool] = Field(default=False, description="Indicates if a document is a one-stop-shop document")
|
||||
item_notes: Optional[List[StrictStr]] = Field(default=None, description="Field holds all unique document_note of items for the document")
|
||||
items: Optional[List[DocumentPosition]] = None
|
||||
last_postbox_id: Optional[StrictInt] = None
|
||||
login_id: Optional[StrictInt] = Field(default=None, description="If omitted or null, the currently active login is used.")
|
||||
number: Optional[StrictStr] = 'null'
|
||||
order_number: Optional[StrictStr] = ''
|
||||
buyer_reference: Optional[StrictStr] = ''
|
||||
paid_amount: Optional[StrictInt] = None
|
||||
paid_at: Optional[date] = None
|
||||
pdf_pages: Optional[StrictInt] = None
|
||||
pdf_template: Optional[StrictStr] = Field(default=None, description="Default template is null or 'DE', default english is 'EN' and for all others use the numeric template ID.")
|
||||
payment_link_enabled: Optional[StrictBool] = Field(default=False, description="Whether the payment link is shown on this document. Overrides the setting from the referenced template.")
|
||||
payment_link_locale: Optional[StrictStr] = Field(default='de', description="Language of the payment link text on the document.")
|
||||
project_id: Optional[StrictInt] = None
|
||||
recurring_options: Optional[DocumentRecurring] = None
|
||||
ref_id: Optional[StrictInt] = Field(default=None, description="Reference document id")
|
||||
root_id: Optional[StrictInt] = Field(default=None, description="Root document id")
|
||||
service_date: Optional[ServiceDate] = None
|
||||
shipping_country: Optional[StrictStr] = 'null'
|
||||
status: Optional[StrictStr] = Field(default=null, description="This value can only be used in document type DELIVERY, ORDER, CHARGE or OFFER. NULL is default = not set.")
|
||||
text: Optional[StrictStr] = None
|
||||
text_prefix: Optional[StrictStr] = None
|
||||
text_tax: Optional[StrictStr] = Field(default='null', description="Overwrites the default vat-option text from the document layout. It is only displayed in documents with the type other than: Delivery, Dunning, Reminder or Letter and a different vat-option than null")
|
||||
title: Optional[StrictStr] = 'null'
|
||||
type: Optional[StrictStr] = Field(default='INVOICE', description="Can only set on create.")
|
||||
use_shipping_address: Optional[StrictBool] = Field(default=False, description="If true and customer has shipping address then it will be used.")
|
||||
vat_country: Optional[StrictStr] = 'null'
|
||||
vat_id: Optional[StrictStr] = ''
|
||||
fulfillment_country: Optional[StrictStr] = 'null'
|
||||
vat_option: Optional[StrictStr] = Field(default=null, description="NULL: Normal steuerbar<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_sync.models.document_payment import DocumentPayment
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DocumentPayments(BaseModel):
|
||||
"""
|
||||
DocumentPayments
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[DocumentPayment]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DocumentPayments from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DocumentPayments from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [DocumentPayment.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
|
@ -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_sync.models.document_version_item import DocumentVersionItem
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DocumentVersion(BaseModel):
|
||||
"""
|
||||
DocumentVersion
|
||||
""" # noqa: E501
|
||||
created_at: Optional[datetime] = None
|
||||
document_id: Optional[StrictInt] = None
|
||||
id: Optional[StrictInt] = None
|
||||
items: Optional[List[DocumentVersionItem]] = None
|
||||
reason: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["created_at", "document_id", "id", "items", "reason"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DocumentVersion from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
* OpenAPI `readOnly` fields are excluded.
|
||||
* OpenAPI `readOnly` fields are excluded.
|
||||
* OpenAPI `readOnly` fields are excluded.
|
||||
* OpenAPI `readOnly` fields are excluded.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
"created_at",
|
||||
"document_id",
|
||||
"id",
|
||||
"reason",
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DocumentVersion from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"created_at": obj.get("created_at"),
|
||||
"document_id": obj.get("document_id"),
|
||||
"id": obj.get("id"),
|
||||
"items": [DocumentVersionItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
||||
"reason": obj.get("reason")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
|
@ -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_sync.models.document_version import DocumentVersion
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DocumentVersions(BaseModel):
|
||||
"""
|
||||
DocumentVersions
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[DocumentVersion]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DocumentVersions from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DocumentVersions from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [DocumentVersion.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
104
generated/sync/easybill_generated_sync/models/documents.py
Normal file
104
generated/sync/easybill_generated_sync/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_sync.models.document import Document
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class Documents(BaseModel):
|
||||
"""
|
||||
Documents
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[Document]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of Documents from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of Documents from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [Document.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
|
@ -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/sync/easybill_generated_sync/models/list.py
Normal file
94
generated/sync/easybill_generated_sync/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/sync/easybill_generated_sync/models/login.py
Normal file
126
generated/sync/easybill_generated_sync/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_sync.models.login_security import LoginSecurity
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class Login(BaseModel):
|
||||
"""
|
||||
Login
|
||||
""" # noqa: E501
|
||||
id: Optional[StrictInt] = None
|
||||
first_name: Optional[StrictStr] = None
|
||||
last_name: Optional[StrictStr] = None
|
||||
display_name: Optional[StrictStr] = None
|
||||
phone: Optional[StrictStr] = None
|
||||
email: Optional[StrictStr] = None
|
||||
email_signature: Optional[StrictStr] = None
|
||||
login_type: Optional[StrictStr] = 'ASSISTANT'
|
||||
locale: Optional[StrictStr] = None
|
||||
time_zone: Optional[StrictStr] = None
|
||||
security: Optional[LoginSecurity] = None
|
||||
__properties: ClassVar[List[str]] = ["id", "first_name", "last_name", "display_name", "phone", "email", "email_signature", "login_type", "locale", "time_zone", "security"]
|
||||
|
||||
@field_validator('login_type')
|
||||
def login_type_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['ADMIN', 'ASSISTANT']):
|
||||
raise ValueError("must be one of enum values ('ADMIN', 'ASSISTANT')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of Login from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
* OpenAPI `readOnly` fields are excluded.
|
||||
* OpenAPI `readOnly` fields are excluded.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
"id",
|
||||
"display_name",
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of security
|
||||
if self.security:
|
||||
_dict['security'] = self.security.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of Login from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"id": obj.get("id"),
|
||||
"first_name": obj.get("first_name"),
|
||||
"last_name": obj.get("last_name"),
|
||||
"display_name": obj.get("display_name"),
|
||||
"phone": obj.get("phone"),
|
||||
"email": obj.get("email"),
|
||||
"email_signature": obj.get("email_signature"),
|
||||
"login_type": obj.get("login_type") if obj.get("login_type") is not None else 'ASSISTANT',
|
||||
"locale": obj.get("locale"),
|
||||
"time_zone": obj.get("time_zone"),
|
||||
"security": LoginSecurity.from_dict(obj["security"]) if obj.get("security") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
|
@ -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/sync/easybill_generated_sync/models/logins.py
Normal file
104
generated/sync/easybill_generated_sync/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_sync.models.login import Login
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class Logins(BaseModel):
|
||||
"""
|
||||
Logins
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[Login]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of Logins from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of Logins from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [Login.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
100
generated/sync/easybill_generated_sync/models/pdf_template.py
Normal file
100
generated/sync/easybill_generated_sync/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_sync.models.pdf_template_settings import PDFTemplateSettings
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class PDFTemplate(BaseModel):
|
||||
"""
|
||||
PDFTemplate
|
||||
""" # noqa: E501
|
||||
id: Optional[StrictStr] = 'INVOICE-DE'
|
||||
name: Optional[StrictStr] = 'Default template'
|
||||
pdf_template: Optional[StrictStr] = 'DE'
|
||||
document_type: Optional[StrictStr] = 'INVOICE'
|
||||
settings: Optional[PDFTemplateSettings] = None
|
||||
__properties: ClassVar[List[str]] = ["id", "name", "pdf_template", "document_type", "settings"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of PDFTemplate from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of settings
|
||||
if self.settings:
|
||||
_dict['settings'] = self.settings.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of PDFTemplate from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"id": obj.get("id") if obj.get("id") is not None else 'INVOICE-DE',
|
||||
"name": obj.get("name") if obj.get("name") is not None else 'Default template',
|
||||
"pdf_template": obj.get("pdf_template") if obj.get("pdf_template") is not None else 'DE',
|
||||
"document_type": obj.get("document_type") if obj.get("document_type") is not None else 'INVOICE',
|
||||
"settings": PDFTemplateSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
|
@ -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_sync.models.pdf_template_settings_email import PDFTemplateSettingsEmail
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class PDFTemplateSettings(BaseModel):
|
||||
"""
|
||||
PDFTemplateSettings
|
||||
""" # noqa: E501
|
||||
text_prefix: Optional[StrictStr] = ''
|
||||
text: Optional[StrictStr] = ''
|
||||
email: Optional[PDFTemplateSettingsEmail] = None
|
||||
__properties: ClassVar[List[str]] = ["text_prefix", "text", "email"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of PDFTemplateSettings from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of email
|
||||
if self.email:
|
||||
_dict['email'] = self.email.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of PDFTemplateSettings from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"text_prefix": obj.get("text_prefix") if obj.get("text_prefix") is not None else '',
|
||||
"text": obj.get("text") if obj.get("text") is not None else '',
|
||||
"email": PDFTemplateSettingsEmail.from_dict(obj["email"]) if obj.get("email") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
|
@ -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_sync.models.pdf_template import PDFTemplate
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class PDFTemplates(BaseModel):
|
||||
"""
|
||||
PDFTemplates
|
||||
""" # noqa: E501
|
||||
items: Optional[List[PDFTemplate]] = None
|
||||
__properties: ClassVar[List[str]] = ["items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of PDFTemplates from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of PDFTemplates from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"items": [PDFTemplate.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
287
generated/sync/easybill_generated_sync/models/position.py
Normal file
287
generated/sync/easybill_generated_sync/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_sync.models.position_export_identifier_extended import PositionExportIdentifierExtended
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class Position(BaseModel):
|
||||
"""
|
||||
Position
|
||||
""" # noqa: E501
|
||||
id: Optional[StrictInt] = None
|
||||
type: Optional[StrictStr] = 'PRODUCT'
|
||||
number: StrictStr
|
||||
description: StrictStr = Field(description="The positions name or description")
|
||||
document_note: Optional[StrictStr] = Field(default=None, description="This field can be used in the document text areas with the liquid placeholder {{document.item_notes}}. Every note is only displayed once for every kind of product. This is useful if you want to add something like an instruction.")
|
||||
note: Optional[StrictStr] = Field(default='null', description="Note for internal use")
|
||||
unit: Optional[StrictStr] = 'null'
|
||||
export_identifier: Optional[StrictStr] = Field(default='null', description="The FAS-Account is the four-digit revenue account, in which the revenue will be entered when doing the export to your tax consultant. In case you want to split your revenue to several revenue accounts, please talk to your tax consultant before, to guarantee an unobstructed use of the interface. For every revenue element, there are number ranges, which can be used. Please avoid using combinations of numbers, which can not be used by your tax consultant.")
|
||||
export_identifier_extended: Optional[PositionExportIdentifierExtended] = None
|
||||
login_id: Optional[StrictInt] = None
|
||||
price_type: Optional[StrictStr] = 'NETTO'
|
||||
vat_percent: Optional[Union[StrictFloat, StrictInt]] = 19.0
|
||||
sale_price: Union[StrictFloat, StrictInt] = Field(description="Price in cents (e.g. \"150\" = 1.50€)")
|
||||
sale_price2: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 2 in cents (e.g. \"150\" = 1.50€)")
|
||||
sale_price3: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 3 in cents (e.g. \"150\" = 1.50€)")
|
||||
sale_price4: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 4 in cents (e.g. \"150\" = 1.50€)")
|
||||
sale_price5: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 5 in cents (e.g. \"150\" = 1.50€)")
|
||||
sale_price6: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 6 in cents (e.g. \"150\" = 1.50€)")
|
||||
sale_price7: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 7 in cents (e.g. \"150\" = 1.50€)")
|
||||
sale_price8: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 8 in cents (e.g. \"150\" = 1.50€)")
|
||||
sale_price9: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 9 in cents (e.g. \"150\" = 1.50€)")
|
||||
sale_price10: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price for customers of group 10 in cents (e.g. \"150\" = 1.50€)")
|
||||
cost_price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price in cents (e.g. \"150\" = 1.50€)")
|
||||
export_cost1: Optional[StrictStr] = 'null'
|
||||
export_cost2: Optional[StrictStr] = 'null'
|
||||
group_id: Optional[StrictInt] = None
|
||||
stock: Optional[StrictStr] = Field(default='NO', description="Activates stock management for this position")
|
||||
stock_count: Optional[StrictInt] = Field(default=None, description="Current stock count")
|
||||
stock_limit_notify: Optional[StrictBool] = Field(default=False, description="Notify when stock_count is lower than stock_limit")
|
||||
stock_limit_notify_frequency: Optional[StrictStr] = Field(default='ALWAYS', description="Notify frequency when stock_count is lower than stock_limit (ALWAYS, ONCE)")
|
||||
stock_limit: Optional[StrictInt] = None
|
||||
quantity: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Used as the default quantity when adding this position to a document")
|
||||
archived: Optional[StrictBool] = False
|
||||
__properties: ClassVar[List[str]] = ["id", "type", "number", "description", "document_note", "note", "unit", "export_identifier", "export_identifier_extended", "login_id", "price_type", "vat_percent", "sale_price", "sale_price2", "sale_price3", "sale_price4", "sale_price5", "sale_price6", "sale_price7", "sale_price8", "sale_price9", "sale_price10", "cost_price", "export_cost1", "export_cost2", "group_id", "stock", "stock_count", "stock_limit_notify", "stock_limit_notify_frequency", "stock_limit", "quantity", "archived"]
|
||||
|
||||
@field_validator('type')
|
||||
def type_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['PRODUCT', 'SERVICE', 'TEXT']):
|
||||
raise ValueError("must be one of enum values ('PRODUCT', 'SERVICE', 'TEXT')")
|
||||
return value
|
||||
|
||||
@field_validator('price_type')
|
||||
def price_type_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['BRUTTO', 'NETTO']):
|
||||
raise ValueError("must be one of enum values ('BRUTTO', 'NETTO')")
|
||||
return value
|
||||
|
||||
@field_validator('stock')
|
||||
def stock_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['YES', 'NO']):
|
||||
raise ValueError("must be one of enum values ('YES', 'NO')")
|
||||
return value
|
||||
|
||||
@field_validator('stock_limit_notify_frequency')
|
||||
def stock_limit_notify_frequency_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['ALWAYS', 'ONCE']):
|
||||
raise ValueError("must be one of enum values ('ALWAYS', 'ONCE')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of Position from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
* OpenAPI `readOnly` fields are excluded.
|
||||
* OpenAPI `readOnly` fields are excluded.
|
||||
* OpenAPI `readOnly` fields are excluded.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
"id",
|
||||
"login_id",
|
||||
"stock_count",
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of export_identifier_extended
|
||||
if self.export_identifier_extended:
|
||||
_dict['export_identifier_extended'] = self.export_identifier_extended.to_dict()
|
||||
# set to None if note (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.note is None and "note" in self.model_fields_set:
|
||||
_dict['note'] = None
|
||||
|
||||
# set to None if unit (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.unit is None and "unit" in self.model_fields_set:
|
||||
_dict['unit'] = None
|
||||
|
||||
# set to None if export_identifier (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.export_identifier is None and "export_identifier" in self.model_fields_set:
|
||||
_dict['export_identifier'] = None
|
||||
|
||||
# set to None if sale_price2 (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.sale_price2 is None and "sale_price2" in self.model_fields_set:
|
||||
_dict['sale_price2'] = None
|
||||
|
||||
# set to None if sale_price3 (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.sale_price3 is None and "sale_price3" in self.model_fields_set:
|
||||
_dict['sale_price3'] = None
|
||||
|
||||
# set to None if sale_price4 (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.sale_price4 is None and "sale_price4" in self.model_fields_set:
|
||||
_dict['sale_price4'] = None
|
||||
|
||||
# set to None if sale_price5 (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.sale_price5 is None and "sale_price5" in self.model_fields_set:
|
||||
_dict['sale_price5'] = None
|
||||
|
||||
# set to None if sale_price6 (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.sale_price6 is None and "sale_price6" in self.model_fields_set:
|
||||
_dict['sale_price6'] = None
|
||||
|
||||
# set to None if sale_price7 (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.sale_price7 is None and "sale_price7" in self.model_fields_set:
|
||||
_dict['sale_price7'] = None
|
||||
|
||||
# set to None if sale_price8 (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.sale_price8 is None and "sale_price8" in self.model_fields_set:
|
||||
_dict['sale_price8'] = None
|
||||
|
||||
# set to None if sale_price9 (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.sale_price9 is None and "sale_price9" in self.model_fields_set:
|
||||
_dict['sale_price9'] = None
|
||||
|
||||
# set to None if sale_price10 (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.sale_price10 is None and "sale_price10" in self.model_fields_set:
|
||||
_dict['sale_price10'] = None
|
||||
|
||||
# set to None if cost_price (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.cost_price is None and "cost_price" in self.model_fields_set:
|
||||
_dict['cost_price'] = None
|
||||
|
||||
# set to None if export_cost1 (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.export_cost1 is None and "export_cost1" in self.model_fields_set:
|
||||
_dict['export_cost1'] = None
|
||||
|
||||
# set to None if export_cost2 (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.export_cost2 is None and "export_cost2" in self.model_fields_set:
|
||||
_dict['export_cost2'] = None
|
||||
|
||||
# set to None if group_id (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.group_id is None and "group_id" in self.model_fields_set:
|
||||
_dict['group_id'] = None
|
||||
|
||||
# set to None if quantity (nullable) is None
|
||||
# and model_fields_set contains the field
|
||||
if self.quantity is None and "quantity" in self.model_fields_set:
|
||||
_dict['quantity'] = None
|
||||
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of Position from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"id": obj.get("id"),
|
||||
"type": obj.get("type") if obj.get("type") is not None else 'PRODUCT',
|
||||
"number": obj.get("number"),
|
||||
"description": obj.get("description"),
|
||||
"document_note": obj.get("document_note"),
|
||||
"note": obj.get("note") if obj.get("note") is not None else 'null',
|
||||
"unit": obj.get("unit") if obj.get("unit") is not None else 'null',
|
||||
"export_identifier": obj.get("export_identifier") if obj.get("export_identifier") is not None else 'null',
|
||||
"export_identifier_extended": PositionExportIdentifierExtended.from_dict(obj["export_identifier_extended"]) if obj.get("export_identifier_extended") is not None else None,
|
||||
"login_id": obj.get("login_id"),
|
||||
"price_type": obj.get("price_type") if obj.get("price_type") is not None else 'NETTO',
|
||||
"vat_percent": obj.get("vat_percent") if obj.get("vat_percent") is not None else 19.0,
|
||||
"sale_price": obj.get("sale_price"),
|
||||
"sale_price2": obj.get("sale_price2"),
|
||||
"sale_price3": obj.get("sale_price3"),
|
||||
"sale_price4": obj.get("sale_price4"),
|
||||
"sale_price5": obj.get("sale_price5"),
|
||||
"sale_price6": obj.get("sale_price6"),
|
||||
"sale_price7": obj.get("sale_price7"),
|
||||
"sale_price8": obj.get("sale_price8"),
|
||||
"sale_price9": obj.get("sale_price9"),
|
||||
"sale_price10": obj.get("sale_price10"),
|
||||
"cost_price": obj.get("cost_price"),
|
||||
"export_cost1": obj.get("export_cost1") if obj.get("export_cost1") is not None else 'null',
|
||||
"export_cost2": obj.get("export_cost2") if obj.get("export_cost2") is not None else 'null',
|
||||
"group_id": obj.get("group_id"),
|
||||
"stock": obj.get("stock") if obj.get("stock") is not None else 'NO',
|
||||
"stock_count": obj.get("stock_count"),
|
||||
"stock_limit_notify": obj.get("stock_limit_notify") if obj.get("stock_limit_notify") is not None else False,
|
||||
"stock_limit_notify_frequency": obj.get("stock_limit_notify_frequency") if obj.get("stock_limit_notify_frequency") is not None else 'ALWAYS',
|
||||
"stock_limit": obj.get("stock_limit"),
|
||||
"quantity": obj.get("quantity"),
|
||||
"archived": obj.get("archived") if obj.get("archived") is not None else False
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
109
generated/sync/easybill_generated_sync/models/position_group.py
Normal file
109
generated/sync/easybill_generated_sync/models/position_group.py
Normal file
|
|
@ -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
|
||||
|
||||
|
||||
104
generated/sync/easybill_generated_sync/models/position_groups.py
Normal file
104
generated/sync/easybill_generated_sync/models/position_groups.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_sync.models.position_group import PositionGroup
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class PositionGroups(BaseModel):
|
||||
"""
|
||||
PositionGroups
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[PositionGroup]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of PositionGroups from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of PositionGroups from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [PositionGroup.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
104
generated/sync/easybill_generated_sync/models/positions.py
Normal file
104
generated/sync/easybill_generated_sync/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_sync.models.position import Position
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class Positions(BaseModel):
|
||||
"""
|
||||
Positions
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[Position]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of Positions from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of Positions from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [Position.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
176
generated/sync/easybill_generated_sync/models/post_box.py
Normal file
176
generated/sync/easybill_generated_sync/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/sync/easybill_generated_sync/models/post_boxes.py
Normal file
104
generated/sync/easybill_generated_sync/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_sync.models.post_box import PostBox
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class PostBoxes(BaseModel):
|
||||
"""
|
||||
PostBoxes
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[PostBox]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of PostBoxes from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of PostBoxes from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [PostBox.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
159
generated/sync/easybill_generated_sync/models/project.py
Normal file
159
generated/sync/easybill_generated_sync/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/sync/easybill_generated_sync/models/projects.py
Normal file
104
generated/sync/easybill_generated_sync/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_sync.models.project import Project
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class Projects(BaseModel):
|
||||
"""
|
||||
Projects
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[Project]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of Projects from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of Projects from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [Project.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
208
generated/sync/easybill_generated_sync/models/sepa_payment.py
Normal file
208
generated/sync/easybill_generated_sync/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/sync/easybill_generated_sync/models/sepa_payments.py
Normal file
104
generated/sync/easybill_generated_sync/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_sync.models.sepa_payment import SEPAPayment
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class SEPAPayments(BaseModel):
|
||||
"""
|
||||
SEPAPayments
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[SEPAPayment]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of SEPAPayments from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of SEPAPayments from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [SEPAPayment.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
125
generated/sync/easybill_generated_sync/models/serial_number.py
Normal file
125
generated/sync/easybill_generated_sync/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
|
||||
|
||||
|
||||
104
generated/sync/easybill_generated_sync/models/serial_numbers.py
Normal file
104
generated/sync/easybill_generated_sync/models/serial_numbers.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_sync.models.serial_number import SerialNumber
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class SerialNumbers(BaseModel):
|
||||
"""
|
||||
SerialNumbers
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[SerialNumber]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of SerialNumbers from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of SerialNumbers from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [SerialNumber.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
127
generated/sync/easybill_generated_sync/models/service_date.py
Normal file
127
generated/sync/easybill_generated_sync/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/sync/easybill_generated_sync/models/stock.py
Normal file
129
generated/sync/easybill_generated_sync/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/sync/easybill_generated_sync/models/stocks.py
Normal file
104
generated/sync/easybill_generated_sync/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_sync.models.stock import Stock
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class Stocks(BaseModel):
|
||||
"""
|
||||
Stocks
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[Stock]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of Stocks from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of Stocks from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [Stock.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
214
generated/sync/easybill_generated_sync/models/task.py
Normal file
214
generated/sync/easybill_generated_sync/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/sync/easybill_generated_sync/models/tasks.py
Normal file
104
generated/sync/easybill_generated_sync/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_sync.models.task import Task
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class Tasks(BaseModel):
|
||||
"""
|
||||
Tasks
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[Task]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of Tasks from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of Tasks from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [Task.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
104
generated/sync/easybill_generated_sync/models/text_templates.py
Normal file
104
generated/sync/easybill_generated_sync/models/text_templates.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_sync.models.text_template import TextTemplate
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class TextTemplates(BaseModel):
|
||||
"""
|
||||
TextTemplates
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[TextTemplate]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of TextTemplates from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of TextTemplates from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [TextTemplate.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
162
generated/sync/easybill_generated_sync/models/time_tracking.py
Normal file
162
generated/sync/easybill_generated_sync/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
|
||||
|
||||
|
||||
104
generated/sync/easybill_generated_sync/models/time_trackings.py
Normal file
104
generated/sync/easybill_generated_sync/models/time_trackings.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_sync.models.time_tracking import TimeTracking
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class TimeTrackings(BaseModel):
|
||||
"""
|
||||
TimeTrackings
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[TimeTracking]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of TimeTrackings from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of TimeTrackings from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [TimeTracking.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
123
generated/sync/easybill_generated_sync/models/web_hook.py
Normal file
123
generated/sync/easybill_generated_sync/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_sync.models.web_hook_last_response import WebHookLastResponse
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class WebHook(BaseModel):
|
||||
"""
|
||||
WebHook
|
||||
""" # noqa: E501
|
||||
content_type: StrictStr
|
||||
description: StrictStr
|
||||
events: List[StrictStr]
|
||||
id: Optional[StrictInt] = None
|
||||
is_active: Optional[StrictBool] = False
|
||||
last_response: Optional[WebHookLastResponse] = None
|
||||
secret: StrictStr
|
||||
url: StrictStr
|
||||
__properties: ClassVar[List[str]] = ["content_type", "description", "events", "id", "is_active", "last_response", "secret", "url"]
|
||||
|
||||
@field_validator('content_type')
|
||||
def content_type_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value not in set(['form', 'json']):
|
||||
raise ValueError("must be one of enum values ('form', 'json')")
|
||||
return value
|
||||
|
||||
@field_validator('events')
|
||||
def events_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
for i in value:
|
||||
if i not in set(['document.create', 'document.update', 'document.completed', 'document.deleted', 'document.payment_add', 'document.payment_delete', 'customer.create', 'customer.update', 'customer.delete', 'contact.create', 'contact.update', 'contact.delete', 'position.create', 'position.update', 'position.delete', 'postbox.create', 'postbox.update', 'postbox.delete', 'postbox.sent']):
|
||||
raise ValueError("each list item must be one of ('document.create', 'document.update', 'document.completed', 'document.deleted', 'document.payment_add', 'document.payment_delete', 'customer.create', 'customer.update', 'customer.delete', 'contact.create', 'contact.update', 'contact.delete', 'position.create', 'position.update', 'position.delete', 'postbox.create', 'postbox.update', 'postbox.delete', 'postbox.sent')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of WebHook from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
* OpenAPI `readOnly` fields are excluded.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
"id",
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of last_response
|
||||
if self.last_response:
|
||||
_dict['last_response'] = self.last_response.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of WebHook from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"content_type": obj.get("content_type"),
|
||||
"description": obj.get("description"),
|
||||
"events": obj.get("events"),
|
||||
"id": obj.get("id"),
|
||||
"is_active": obj.get("is_active") if obj.get("is_active") is not None else False,
|
||||
"last_response": WebHookLastResponse.from_dict(obj["last_response"]) if obj.get("last_response") is not None else None,
|
||||
"secret": obj.get("secret"),
|
||||
"url": obj.get("url")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
|
@ -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/sync/easybill_generated_sync/models/web_hooks.py
Normal file
104
generated/sync/easybill_generated_sync/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_sync.models.web_hook import WebHook
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class WebHooks(BaseModel):
|
||||
"""
|
||||
WebHooks
|
||||
""" # noqa: E501
|
||||
page: StrictInt = Field(description="The current page")
|
||||
pages: StrictInt = Field(description="Max possible pages")
|
||||
limit: StrictInt = Field(description="Items limitation. Max 1000")
|
||||
total: StrictInt = Field(description="Total Items")
|
||||
items: Optional[List[WebHook]] = None
|
||||
__properties: ClassVar[List[str]] = ["page", "pages", "limit", "total", "items"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of WebHooks from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
||||
_items = []
|
||||
if self.items:
|
||||
for _item_items in self.items:
|
||||
if _item_items:
|
||||
_items.append(_item_items.to_dict())
|
||||
_dict['items'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of WebHooks from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"page": obj.get("page"),
|
||||
"pages": obj.get("pages"),
|
||||
"limit": obj.get("limit"),
|
||||
"total": obj.get("total"),
|
||||
"items": [WebHook.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue