From 7cda3274e87cd127c4a153a11a43d7e29475fd24 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Fri, 13 Dec 2024 00:30:34 +0000 Subject: [PATCH] wip(today's fortune): A day without sunshine is like night. --- sources/affinity/__init__.py | 10 +++++++--- sources/affinity/rest_client.py | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sources/affinity/__init__.py b/sources/affinity/__init__.py index 879a68106..4880a25b1 100644 --- a/sources/affinity/__init__.py +++ b/sources/affinity/__init__.py @@ -11,7 +11,13 @@ from pydantic import TypeAdapter -from .rest_client import get_v1_rest_client, get_v2_rest_client, hooks +from .rest_client import ( + get_v1_rest_client, + get_v2_rest_client, + hooks, + MAX_PAGE_LIMIT_V1, + MAX_PAGE_LIMIT_V2, +) from .type_adapters import note_adapter, list_adapter from .model.v1 import Note from .model.v2 import * @@ -28,8 +34,6 @@ LISTS_LITERAL = Literal["lists"] ENTITY = Literal["companies", "persons", "opportunities"] -MAX_PAGE_LIMIT_V1 = 500 -MAX_PAGE_LIMIT_V2 = 100 def get_entity_data_class(entity: ENTITY | LISTS_LITERAL): diff --git a/sources/affinity/rest_client.py b/sources/affinity/rest_client.py index 511d8ef6c..5506f5fcf 100644 --- a/sources/affinity/rest_client.py +++ b/sources/affinity/rest_client.py @@ -38,3 +38,5 @@ def raise_if_error(response: Response, *args: Any, **kwargs: Any) -> None: hooks = {"response": [raise_if_error]} +MAX_PAGE_LIMIT_V1 = 500 +MAX_PAGE_LIMIT_V2 = 100