Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 1, 2024
1 parent 1c8de5c commit 3efe078
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 19 deletions.
1 change: 1 addition & 0 deletions dev/generate_filter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Helper script to automatically generate pydantic models from a swagger spec
"""

import json
import sys
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions easyverein/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Main EasyVerein API class
"""

import logging

from .core.client import EasyvereinClient
Expand Down
1 change: 1 addition & 0 deletions easyverein/core/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Main EasyVerein API class
"""

from __future__ import annotations

import logging
Expand Down
15 changes: 5 additions & 10 deletions easyverein/core/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,16 @@
# noinspection PyPropertyDefinition
class IsEVClientProtocol(Protocol):
@property
def logger(self) -> logging.Logger:
...
def logger(self) -> logging.Logger: ...

@property
def c(self) -> EasyvereinClient:
...
def c(self) -> EasyvereinClient: ...

@property
def endpoint_name(self) -> str:
...
def endpoint_name(self) -> str: ...

@property
def model_class(self) -> TypeVar:
...
def model_class(self) -> TypeVar: ...

@property
def return_type(self) -> Type[BaseModel]:
...
def return_type(self) -> Type[BaseModel]: ...
1 change: 1 addition & 0 deletions easyverein/core/types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Custom types used for model validation
"""

import datetime
import json
from typing import Annotated
Expand Down
1 change: 1 addition & 0 deletions easyverein/models/contact_details.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Contact Details related models
"""

from __future__ import annotations

from typing import Any, Literal
Expand Down
16 changes: 10 additions & 6 deletions easyverein/models/custom_field.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Member related models
"""

from __future__ import annotations

from typing import Literal
Expand Down Expand Up @@ -36,9 +37,9 @@ class CustomFieldBase(EasyVereinBase):
color: HexColor = None
short: str | None = Field(default=None, max_length=4)
orderSequence: PositiveIntWithZero | None = None
settings_type: Literal[
"t", "f", "z", "d", "c", "r", "s", "a", "b", "m"
] | None = None
settings_type: Literal["t", "f", "z", "d", "c", "r", "s", "a", "b", "m"] | None = (
None
)
"""
Settings type defines which type of field this custom field should be. Possible values:
Expand All @@ -55,9 +56,12 @@ class CustomFieldBase(EasyVereinBase):
If type is set to s or a, the possible options need to be defined in the additional field
"""
kind: Literal[
"a", "b", "ba", "ca", "iv", "t", "u", "ic", "c", "e", "h", "j", "i", "k"
] | None = None
kind: (
Literal[
"a", "b", "ba", "ca", "iv", "t", "u", "ic", "c", "e", "h", "j", "i", "k"
]
| None
) = None
"""
Kind defines in which context this custom field is used. Unfortunately only some possible values are
documented in the API spec:
Expand Down
16 changes: 13 additions & 3 deletions easyverein/models/invoice.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Invoice related models
"""

from __future__ import annotations

from typing import Literal
Expand Down Expand Up @@ -42,9 +43,18 @@ class InvoiceBase(EasyVereinBase):
taxName: str | None = None
relatedAddress: ContactDetails | EasyVereinReference | None = None
path: EasyVereinReference | None = None
kind: Literal[
"balance", "donation", "membership", "revenue", "expense", "cancel", "credit"
] | None = None
kind: (
Literal[
"balance",
"donation",
"membership",
"revenue",
"expense",
"cancel",
"credit",
]
| None
) = None
# TODO: Add reference to BillingAccount once implemented
selectionAcc: EasyVereinReference | None = None
refNumber: str | None = None
Expand Down
1 change: 1 addition & 0 deletions easyverein/models/invoice_item.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Invoice Item model
"""

from __future__ import annotations

from typing import Annotated
Expand Down
1 change: 1 addition & 0 deletions easyverein/models/member.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Member related models
"""

from __future__ import annotations

from typing import Literal
Expand Down
1 change: 1 addition & 0 deletions easyverein/models/mixins/empty_strings_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This module contains a generic plugin for Pydantic models that removes
empty strings and converts them to None.
"""

from typing import Any

from pydantic import model_validator
Expand Down
1 change: 1 addition & 0 deletions easyverein/models/mixins/required_attributes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains a class factory returning a Mixin class
"""

from typing import Self

from pydantic import BaseModel, model_validator
Expand Down
1 change: 1 addition & 0 deletions easyverein/modules/contact_details.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
All methods related to contact details
"""

import logging

from ..core.client import EasyvereinClient
Expand Down
1 change: 1 addition & 0 deletions easyverein/modules/custom_field.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
All methods related to custom fields
"""

import logging

from ..core.client import EasyvereinClient
Expand Down
1 change: 1 addition & 0 deletions easyverein/modules/invoice_item.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
All methods related to invoices
"""

import logging

from ..core.client import EasyvereinClient
Expand Down
1 change: 1 addition & 0 deletions easyverein/modules/member.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
All methods related to invoices
"""

import logging

from ..core.client import EasyvereinClient
Expand Down
1 change: 1 addition & 0 deletions easyverein/modules/member_custom_field.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
All methods related to invoices
"""

import logging

from ..core.client import EasyvereinClient
Expand Down

0 comments on commit 3efe078

Please sign in to comment.