feat: rewrite SDK from camelCase/requests to snake_case/httpx/Pydantic v2
- Replace OnspringApiSdk package with onspring_api_sdk package - Add sync (OnspringClient) and async (AsyncOnspringClient) clients - Migrate from requests to httpx for HTTP transport - Migrate from raw dataclasses to Pydantic v2 models with alias support - Add shared response handler module (_responses.py) to reduce duplication - Add typed exceptions (OnspringError, OnspringAuthenticationError, etc.) - Preserve full API coverage for apps, fields, files, lists, records, and reports
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
"""Enumerations for Onspring API data types and timespan configuration."""
|
||||
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class DataFormat(Enum):
|
||||
"""The possible data format types for record field values."""
|
||||
|
||||
Raw: int = 0
|
||||
Formatted: int = 1
|
||||
|
||||
|
||||
class ReportDataType(Enum):
|
||||
"""The possible report data types for reports."""
|
||||
|
||||
ReportData: int = 0
|
||||
ChartData: int = 1
|
||||
|
||||
|
||||
class ResultValueType(Enum):
|
||||
"""The possible types for record field values."""
|
||||
|
||||
String: int = 0
|
||||
Integer: int = 1
|
||||
Decimal: int = 2
|
||||
Date: int = 3
|
||||
TimeSpan: int = 4
|
||||
Guid: int = 5
|
||||
StringList: int = 6
|
||||
IntegerList: int = 7
|
||||
GuidList: int = 8
|
||||
AttachmentList: int = 9
|
||||
ScoringGroupList: int = 10
|
||||
FileList: int = 11
|
||||
|
||||
|
||||
class Increment(Enum):
|
||||
"""Possible increment values for timespan data in an Onspring timespan field."""
|
||||
|
||||
Seconds: str = "Second(s)"
|
||||
Minutes: str = "Minute(s)"
|
||||
Hours: str = "Hour(s)"
|
||||
Days: str = "Day(s)"
|
||||
Weeks: str = "Week(s)"
|
||||
Months: str = "Month(s)"
|
||||
Years: str = "Year(s)"
|
||||
|
||||
|
||||
class Recurrence(Enum):
|
||||
"""Possible recurrence values for timespan data in an Onspring timespan field."""
|
||||
|
||||
Empty: str = "None"
|
||||
EndByDate: str = "EndByDate"
|
||||
EndAfterOccurrences: str = "EndAfterOccurrences"
|
||||
Reference in New Issue
Block a user