Skip to content

Commit 5590aa8

Browse files
Automatically update Python SDK
1 parent 405ce90 commit 5590aa8

123 files changed

Lines changed: 6810 additions & 3546 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,6 @@ cython_debug/
169169

170170
# PyPI configuration file
171171
.pypirc
172+
173+
# OSX
174+
.DS_Store

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "trophy"
7-
version = "1.0.29"
7+
version = "1.0.30"
88
description = "A Python library for the Trophy API"
99
license = {text = "MIT"}
1010
readme = "README.md"

trophy/__init__.py

Lines changed: 211 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,200 @@
11
# This file was auto-generated by Fern from our API Definition.
22

3-
from .types import (
4-
AchievementCompletionResponse,
5-
AchievementResponse,
6-
AchievementResponseTrigger,
7-
AchievementWithStatsResponse,
8-
AchievementWithStatsResponseEventAttribute,
9-
AchievementWithStatsResponseUserAttributesItem,
10-
BaseStreakResponse,
11-
BulkInsertIssue,
12-
BulkInsertIssueLevel,
13-
BulkStreakResponse,
14-
BulkStreakResponseItem,
15-
CompletedAchievementResponse,
16-
CreateStreakFreezesResponse,
17-
ErrorBody,
18-
EventResponse,
19-
GetUserPointsResponse,
20-
LeaderboardEvent,
21-
LeaderboardRanking,
22-
LeaderboardResponse,
23-
LeaderboardResponseRankBy,
24-
LeaderboardResponseStatus,
25-
LeaderboardResponseWithRankings,
26-
MetricEventLeaderboardResponse,
27-
MetricEventPointsResponse,
28-
MetricEventStreakResponse,
29-
MetricResponse,
30-
MetricStatus,
31-
PointsAward,
32-
PointsRange,
33-
PointsSummaryResponse,
34-
PointsSystemResponse,
35-
PointsTrigger,
36-
PointsTriggerResponse,
37-
PointsTriggerResponseEventAttribute,
38-
PointsTriggerResponseStatus,
39-
PointsTriggerResponseType,
40-
PointsTriggerResponseUserAttributesItem,
41-
PointsTriggerType,
42-
StreakFrequency,
43-
StreakRankingUser,
44-
StreakResponse,
45-
StreakResponseStreakHistoryItem,
46-
UpdatedUser,
47-
UpsertedUser,
48-
User,
49-
UserLeaderboardResponse,
50-
)
51-
from .errors import (
52-
BadRequestError,
53-
NotFoundError,
54-
UnauthorizedError,
55-
UnprocessableEntityError,
56-
)
57-
from . import achievements, admin, leaderboards, metrics, points, streaks, users
58-
from .client import AsyncTrophyApi, TrophyApi
59-
from .environment import TrophyApiEnvironment
60-
from .streaks import StreaksRankingsRequestType
61-
from .users import (
62-
UsersMetricEventSummaryRequestAggregation,
63-
UsersMetricEventSummaryResponseItem,
64-
UsersPointsEventSummaryRequestAggregation,
65-
UsersPointsEventSummaryResponseItem,
66-
)
3+
# isort: skip_file
4+
5+
import typing
6+
from importlib import import_module
7+
8+
if typing.TYPE_CHECKING:
9+
from .types import (
10+
AchievementCompletionResponse,
11+
AchievementCompletionResponseAchievement,
12+
AchievementResponse,
13+
AchievementResponseTrigger,
14+
AchievementWithStatsResponse,
15+
AchievementWithStatsResponseEventAttribute,
16+
AchievementWithStatsResponseUserAttributesItem,
17+
BaseStreakResponse,
18+
BulkInsertIssue,
19+
BulkInsertIssueLevel,
20+
BulkStreakResponse,
21+
BulkStreakResponseItem,
22+
CompletedAchievementResponse,
23+
CreateStreakFreezesResponse,
24+
ErrorBody,
25+
EventResponse,
26+
GetUserPointsResponse,
27+
LeaderboardEvent,
28+
LeaderboardRanking,
29+
LeaderboardResponse,
30+
LeaderboardResponseRankBy,
31+
LeaderboardResponseRunUnit,
32+
LeaderboardResponseWithRankings,
33+
LeaderboardResponseWithRankingsStatus,
34+
MetricEventLeaderboardResponse,
35+
MetricEventPointsResponse,
36+
MetricEventStreakResponse,
37+
MetricResponse,
38+
MetricStatus,
39+
PointsAward,
40+
PointsRange,
41+
PointsSummaryResponse,
42+
PointsSystemResponse,
43+
PointsTrigger,
44+
PointsTriggerResponse,
45+
PointsTriggerResponseEventAttribute,
46+
PointsTriggerResponseStatus,
47+
PointsTriggerResponseTimeUnit,
48+
PointsTriggerResponseType,
49+
PointsTriggerResponseUserAttributesItem,
50+
PointsTriggerTimeUnit,
51+
PointsTriggerType,
52+
StreakFrequency,
53+
StreakRankingUser,
54+
StreakResponse,
55+
StreakResponseStreakHistoryItem,
56+
UpdatedUser,
57+
UpsertedUser,
58+
User,
59+
UserLeaderboardResponse,
60+
UserLeaderboardResponseWithHistory,
61+
WebhookUserLeaderboardResponse,
62+
WebhooksAchievementCompletedPayload,
63+
WebhooksLeaderboardChangedPayload,
64+
WebhooksLeaderboardFinishedPayload,
65+
WebhooksLeaderboardRankChangedPayload,
66+
WebhooksLeaderboardStartedPayload,
67+
WebhooksPointsChangedPayload,
68+
WebhooksStreakExtendedPayload,
69+
WebhooksStreakFreezeConsumedPayload,
70+
WebhooksStreakFreezeEarnedPayload,
71+
WebhooksStreakLostPayload,
72+
WebhooksStreakStartedPayload,
73+
)
74+
from .errors import BadRequestError, NotFoundError, UnauthorizedError, UnprocessableEntityError
75+
from . import achievements, admin, leaderboards, metrics, points, streaks, users
76+
from .client import AsyncTrophyApi, TrophyApi
77+
from .environment import TrophyApiEnvironment
78+
from .leaderboards import LeaderboardsAllResponseItem, LeaderboardsAllResponseItemStatus
79+
from .streaks import StreaksRankingsRequestType
80+
from .users import (
81+
UsersMetricEventSummaryRequestAggregation,
82+
UsersMetricEventSummaryResponseItem,
83+
UsersPointsEventSummaryRequestAggregation,
84+
UsersPointsEventSummaryResponseItem,
85+
)
86+
_dynamic_imports: typing.Dict[str, str] = {
87+
"AchievementCompletionResponse": ".types",
88+
"AchievementCompletionResponseAchievement": ".types",
89+
"AchievementResponse": ".types",
90+
"AchievementResponseTrigger": ".types",
91+
"AchievementWithStatsResponse": ".types",
92+
"AchievementWithStatsResponseEventAttribute": ".types",
93+
"AchievementWithStatsResponseUserAttributesItem": ".types",
94+
"AsyncTrophyApi": ".client",
95+
"BadRequestError": ".errors",
96+
"BaseStreakResponse": ".types",
97+
"BulkInsertIssue": ".types",
98+
"BulkInsertIssueLevel": ".types",
99+
"BulkStreakResponse": ".types",
100+
"BulkStreakResponseItem": ".types",
101+
"CompletedAchievementResponse": ".types",
102+
"CreateStreakFreezesResponse": ".types",
103+
"ErrorBody": ".types",
104+
"EventResponse": ".types",
105+
"GetUserPointsResponse": ".types",
106+
"LeaderboardEvent": ".types",
107+
"LeaderboardRanking": ".types",
108+
"LeaderboardResponse": ".types",
109+
"LeaderboardResponseRankBy": ".types",
110+
"LeaderboardResponseRunUnit": ".types",
111+
"LeaderboardResponseWithRankings": ".types",
112+
"LeaderboardResponseWithRankingsStatus": ".types",
113+
"LeaderboardsAllResponseItem": ".leaderboards",
114+
"LeaderboardsAllResponseItemStatus": ".leaderboards",
115+
"MetricEventLeaderboardResponse": ".types",
116+
"MetricEventPointsResponse": ".types",
117+
"MetricEventStreakResponse": ".types",
118+
"MetricResponse": ".types",
119+
"MetricStatus": ".types",
120+
"NotFoundError": ".errors",
121+
"PointsAward": ".types",
122+
"PointsRange": ".types",
123+
"PointsSummaryResponse": ".types",
124+
"PointsSystemResponse": ".types",
125+
"PointsTrigger": ".types",
126+
"PointsTriggerResponse": ".types",
127+
"PointsTriggerResponseEventAttribute": ".types",
128+
"PointsTriggerResponseStatus": ".types",
129+
"PointsTriggerResponseTimeUnit": ".types",
130+
"PointsTriggerResponseType": ".types",
131+
"PointsTriggerResponseUserAttributesItem": ".types",
132+
"PointsTriggerTimeUnit": ".types",
133+
"PointsTriggerType": ".types",
134+
"StreakFrequency": ".types",
135+
"StreakRankingUser": ".types",
136+
"StreakResponse": ".types",
137+
"StreakResponseStreakHistoryItem": ".types",
138+
"StreaksRankingsRequestType": ".streaks",
139+
"TrophyApi": ".client",
140+
"TrophyApiEnvironment": ".environment",
141+
"UnauthorizedError": ".errors",
142+
"UnprocessableEntityError": ".errors",
143+
"UpdatedUser": ".types",
144+
"UpsertedUser": ".types",
145+
"User": ".types",
146+
"UserLeaderboardResponse": ".types",
147+
"UserLeaderboardResponseWithHistory": ".types",
148+
"UsersMetricEventSummaryRequestAggregation": ".users",
149+
"UsersMetricEventSummaryResponseItem": ".users",
150+
"UsersPointsEventSummaryRequestAggregation": ".users",
151+
"UsersPointsEventSummaryResponseItem": ".users",
152+
"WebhookUserLeaderboardResponse": ".types",
153+
"WebhooksAchievementCompletedPayload": ".types",
154+
"WebhooksLeaderboardChangedPayload": ".types",
155+
"WebhooksLeaderboardFinishedPayload": ".types",
156+
"WebhooksLeaderboardRankChangedPayload": ".types",
157+
"WebhooksLeaderboardStartedPayload": ".types",
158+
"WebhooksPointsChangedPayload": ".types",
159+
"WebhooksStreakExtendedPayload": ".types",
160+
"WebhooksStreakFreezeConsumedPayload": ".types",
161+
"WebhooksStreakFreezeEarnedPayload": ".types",
162+
"WebhooksStreakLostPayload": ".types",
163+
"WebhooksStreakStartedPayload": ".types",
164+
"achievements": ".achievements",
165+
"admin": ".admin",
166+
"leaderboards": ".leaderboards",
167+
"metrics": ".metrics",
168+
"points": ".points",
169+
"streaks": ".streaks",
170+
"users": ".users",
171+
}
172+
173+
174+
def __getattr__(attr_name: str) -> typing.Any:
175+
module_name = _dynamic_imports.get(attr_name)
176+
if module_name is None:
177+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
178+
try:
179+
module = import_module(module_name, __package__)
180+
if module_name == f".{attr_name}":
181+
return module
182+
else:
183+
return getattr(module, attr_name)
184+
except ImportError as e:
185+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
186+
except AttributeError as e:
187+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
188+
189+
190+
def __dir__():
191+
lazy_attrs = list(_dynamic_imports.keys())
192+
return sorted(lazy_attrs)
193+
67194

68195
__all__ = [
69196
"AchievementCompletionResponse",
197+
"AchievementCompletionResponseAchievement",
70198
"AchievementResponse",
71199
"AchievementResponseTrigger",
72200
"AchievementWithStatsResponse",
@@ -88,8 +216,11 @@
88216
"LeaderboardRanking",
89217
"LeaderboardResponse",
90218
"LeaderboardResponseRankBy",
91-
"LeaderboardResponseStatus",
219+
"LeaderboardResponseRunUnit",
92220
"LeaderboardResponseWithRankings",
221+
"LeaderboardResponseWithRankingsStatus",
222+
"LeaderboardsAllResponseItem",
223+
"LeaderboardsAllResponseItemStatus",
93224
"MetricEventLeaderboardResponse",
94225
"MetricEventPointsResponse",
95226
"MetricEventStreakResponse",
@@ -104,8 +235,10 @@
104235
"PointsTriggerResponse",
105236
"PointsTriggerResponseEventAttribute",
106237
"PointsTriggerResponseStatus",
238+
"PointsTriggerResponseTimeUnit",
107239
"PointsTriggerResponseType",
108240
"PointsTriggerResponseUserAttributesItem",
241+
"PointsTriggerTimeUnit",
109242
"PointsTriggerType",
110243
"StreakFrequency",
111244
"StreakRankingUser",
@@ -120,10 +253,23 @@
120253
"UpsertedUser",
121254
"User",
122255
"UserLeaderboardResponse",
256+
"UserLeaderboardResponseWithHistory",
123257
"UsersMetricEventSummaryRequestAggregation",
124258
"UsersMetricEventSummaryResponseItem",
125259
"UsersPointsEventSummaryRequestAggregation",
126260
"UsersPointsEventSummaryResponseItem",
261+
"WebhookUserLeaderboardResponse",
262+
"WebhooksAchievementCompletedPayload",
263+
"WebhooksLeaderboardChangedPayload",
264+
"WebhooksLeaderboardFinishedPayload",
265+
"WebhooksLeaderboardRankChangedPayload",
266+
"WebhooksLeaderboardStartedPayload",
267+
"WebhooksPointsChangedPayload",
268+
"WebhooksStreakExtendedPayload",
269+
"WebhooksStreakFreezeConsumedPayload",
270+
"WebhooksStreakFreezeEarnedPayload",
271+
"WebhooksStreakLostPayload",
272+
"WebhooksStreakStartedPayload",
127273
"achievements",
128274
"admin",
129275
"leaderboards",

trophy/achievements/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# This file was auto-generated by Fern from our API Definition.
22

3+
# isort: skip_file
4+

0 commit comments

Comments
 (0)