Skip to content

Commit 6007fc0

Browse files
Automatically update Python SDK
1 parent 1f4c6a3 commit 6007fc0

36 files changed

Lines changed: 1692 additions & 6 deletions

‎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.8.0"
7+
version = "1.9.1"
88
description = "A Python library for the Trophy API"
99
license = {text = "MIT"}
1010
readme = "README.md"

‎trophy/__init__.py‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
AdminPointsTriggerTimeUnit,
3838
AdminPointsTriggerType,
3939
AdminPointsTriggerUserAttributesItem,
40+
AdminTenant,
41+
AdminTenantStatus,
4042
BaseStreakResponse,
4143
BulkStreakResponse,
4244
BulkStreakResponseItem,
@@ -76,6 +78,9 @@
7678
CreatePointsTriggersRequest,
7779
CreatePointsTriggersResponse,
7880
CreateStreakFreezesResponse,
81+
CreateTenantRequestItem,
82+
CreateTenantsRequest,
83+
CreateTenantsResponse,
7984
CreatedAdminPointsSystem,
8085
CreatedMetric,
8186
CreatedMetricUnitType,
@@ -86,6 +91,7 @@
8691
DeletePointsLevelsResponse,
8792
DeletePointsSystemsResponse,
8893
DeletePointsTriggersResponse,
94+
DeleteTenantsResponse,
8995
DeletedResource,
9096
ErrorBody,
9197
EventResponse,
@@ -104,6 +110,7 @@
104110
ListPointsLevelsResponse,
105111
ListPointsSystemsResponse,
106112
ListPointsTriggersResponse,
113+
ListTenantsResponse,
107114
MetricEventLeaderboardResponse,
108115
MetricEventLeaderboardResponseBreakdownAttributeValuesItem,
109116
MetricEventPointsResponse,
@@ -171,6 +178,9 @@
171178
UpdatePointsSystemRequestItemBadge,
172179
UpdatePointsSystemsRequest,
173180
UpdatePointsSystemsResponse,
181+
UpdateTenantRequestItem,
182+
UpdateTenantsRequest,
183+
UpdateTenantsResponse,
174184
UpdatedUser,
175185
UpsertedUser,
176186
User,
@@ -250,6 +260,8 @@
250260
"AdminPointsTriggerTimeUnit": ".types",
251261
"AdminPointsTriggerType": ".types",
252262
"AdminPointsTriggerUserAttributesItem": ".types",
263+
"AdminTenant": ".types",
264+
"AdminTenantStatus": ".types",
253265
"AsyncTrophyApi": ".client",
254266
"BadRequestError": ".errors",
255267
"BaseStreakResponse": ".types",
@@ -291,6 +303,9 @@
291303
"CreatePointsTriggersRequest": ".types",
292304
"CreatePointsTriggersResponse": ".types",
293305
"CreateStreakFreezesResponse": ".types",
306+
"CreateTenantRequestItem": ".types",
307+
"CreateTenantsRequest": ".types",
308+
"CreateTenantsResponse": ".types",
294309
"CreatedAdminPointsSystem": ".types",
295310
"CreatedMetric": ".types",
296311
"CreatedMetricUnitType": ".types",
@@ -301,6 +316,7 @@
301316
"DeletePointsLevelsResponse": ".types",
302317
"DeletePointsSystemsResponse": ".types",
303318
"DeletePointsTriggersResponse": ".types",
319+
"DeleteTenantsResponse": ".types",
304320
"DeletedResource": ".types",
305321
"ErrorBody": ".types",
306322
"EventResponse": ".types",
@@ -321,6 +337,7 @@
321337
"ListPointsLevelsResponse": ".types",
322338
"ListPointsSystemsResponse": ".types",
323339
"ListPointsTriggersResponse": ".types",
340+
"ListTenantsResponse": ".types",
324341
"MetricEventLeaderboardResponse": ".types",
325342
"MetricEventLeaderboardResponseBreakdownAttributeValuesItem": ".types",
326343
"MetricEventPointsResponse": ".types",
@@ -394,6 +411,9 @@
394411
"UpdatePointsSystemRequestItemBadge": ".types",
395412
"UpdatePointsSystemsRequest": ".types",
396413
"UpdatePointsSystemsResponse": ".types",
414+
"UpdateTenantRequestItem": ".types",
415+
"UpdateTenantsRequest": ".types",
416+
"UpdateTenantsResponse": ".types",
397417
"UpdatedUser": ".types",
398418
"UpsertedUser": ".types",
399419
"User": ".types",
@@ -495,6 +515,8 @@ def __dir__():
495515
"AdminPointsTriggerTimeUnit",
496516
"AdminPointsTriggerType",
497517
"AdminPointsTriggerUserAttributesItem",
518+
"AdminTenant",
519+
"AdminTenantStatus",
498520
"AsyncTrophyApi",
499521
"BadRequestError",
500522
"BaseStreakResponse",
@@ -536,6 +558,9 @@ def __dir__():
536558
"CreatePointsTriggersRequest",
537559
"CreatePointsTriggersResponse",
538560
"CreateStreakFreezesResponse",
561+
"CreateTenantRequestItem",
562+
"CreateTenantsRequest",
563+
"CreateTenantsResponse",
539564
"CreatedAdminPointsSystem",
540565
"CreatedMetric",
541566
"CreatedMetricUnitType",
@@ -546,6 +571,7 @@ def __dir__():
546571
"DeletePointsLevelsResponse",
547572
"DeletePointsSystemsResponse",
548573
"DeletePointsTriggersResponse",
574+
"DeleteTenantsResponse",
549575
"DeletedResource",
550576
"ErrorBody",
551577
"EventResponse",
@@ -566,6 +592,7 @@ def __dir__():
566592
"ListPointsLevelsResponse",
567593
"ListPointsSystemsResponse",
568594
"ListPointsTriggersResponse",
595+
"ListTenantsResponse",
569596
"MetricEventLeaderboardResponse",
570597
"MetricEventLeaderboardResponseBreakdownAttributeValuesItem",
571598
"MetricEventPointsResponse",
@@ -639,6 +666,9 @@ def __dir__():
639666
"UpdatePointsSystemRequestItemBadge",
640667
"UpdatePointsSystemsRequest",
641668
"UpdatePointsSystemsResponse",
669+
"UpdateTenantRequestItem",
670+
"UpdateTenantsRequest",
671+
"UpdateTenantsResponse",
642672
"UpdatedUser",
643673
"UpsertedUser",
644674
"User",

‎trophy/achievements/client.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def all_(
5252
from trophy import TrophyApi
5353
5454
client = TrophyApi(
55+
tenant_id="YOUR_TENANT_ID",
5556
api_key="YOUR_API_KEY",
5657
)
5758
client.achievements.all_(
@@ -88,6 +89,7 @@ def complete(
8889
from trophy import TrophyApi, UpsertedUser
8990
9091
client = TrophyApi(
92+
tenant_id="YOUR_TENANT_ID",
9193
api_key="YOUR_API_KEY",
9294
)
9395
client.achievements.complete(
@@ -144,6 +146,7 @@ async def all_(
144146
from trophy import AsyncTrophyApi
145147
146148
client = AsyncTrophyApi(
149+
tenant_id="YOUR_TENANT_ID",
147150
api_key="YOUR_API_KEY",
148151
)
149152
@@ -188,6 +191,7 @@ async def complete(
188191
from trophy import AsyncTrophyApi, UpsertedUser
189192
190193
client = AsyncTrophyApi(
194+
tenant_id="YOUR_TENANT_ID",
191195
api_key="YOUR_API_KEY",
192196
)
193197

‎trophy/admin/__init__.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from importlib import import_module
77

88
if typing.TYPE_CHECKING:
9-
from . import attributes, leaderboards, metrics, points, streaks
9+
from . import attributes, leaderboards, metrics, points, streaks, tenants
1010
from .streaks import RestoreStreaksRequestUsersItem
1111
_dynamic_imports: typing.Dict[str, str] = {
1212
"RestoreStreaksRequestUsersItem": ".streaks",
@@ -15,6 +15,7 @@
1515
"metrics": ".metrics",
1616
"points": ".points",
1717
"streaks": ".streaks",
18+
"tenants": ".tenants",
1819
}
1920

2021

@@ -39,4 +40,4 @@ def __dir__():
3940
return sorted(lazy_attrs)
4041

4142

42-
__all__ = ["RestoreStreaksRequestUsersItem", "attributes", "leaderboards", "metrics", "points", "streaks"]
43+
__all__ = ["RestoreStreaksRequestUsersItem", "attributes", "leaderboards", "metrics", "points", "streaks", "tenants"]

‎trophy/admin/attributes/client.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def list(
6363
from trophy import TrophyApi
6464
6565
client = TrophyApi(
66+
tenant_id="YOUR_TENANT_ID",
6667
api_key="YOUR_API_KEY",
6768
)
6869
client.admin.attributes.list(
@@ -96,6 +97,7 @@ def create(
9697
from trophy import CreateAttributeRequestItem, TrophyApi
9798
9899
client = TrophyApi(
100+
tenant_id="YOUR_TENANT_ID",
99101
api_key="YOUR_API_KEY",
100102
)
101103
client.admin.attributes.create(
@@ -143,6 +145,7 @@ def delete(
143145
from trophy import TrophyApi
144146
145147
client = TrophyApi(
148+
tenant_id="YOUR_TENANT_ID",
146149
api_key="YOUR_API_KEY",
147150
)
148151
client.admin.attributes.delete()
@@ -173,6 +176,7 @@ def update(
173176
from trophy import TrophyApi, UpdateAttributeRequestItem
174177
175178
client = TrophyApi(
179+
tenant_id="YOUR_TENANT_ID",
176180
api_key="YOUR_API_KEY",
177181
)
178182
client.admin.attributes.update(
@@ -209,6 +213,7 @@ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = Non
209213
from trophy import TrophyApi
210214
211215
client = TrophyApi(
216+
tenant_id="YOUR_TENANT_ID",
212217
api_key="YOUR_API_KEY",
213218
)
214219
client.admin.attributes.get(
@@ -267,6 +272,7 @@ async def list(
267272
from trophy import AsyncTrophyApi
268273
269274
client = AsyncTrophyApi(
275+
tenant_id="YOUR_TENANT_ID",
270276
api_key="YOUR_API_KEY",
271277
)
272278
@@ -308,6 +314,7 @@ async def create(
308314
from trophy import AsyncTrophyApi, CreateAttributeRequestItem
309315
310316
client = AsyncTrophyApi(
317+
tenant_id="YOUR_TENANT_ID",
311318
api_key="YOUR_API_KEY",
312319
)
313320
@@ -363,6 +370,7 @@ async def delete(
363370
from trophy import AsyncTrophyApi
364371
365372
client = AsyncTrophyApi(
373+
tenant_id="YOUR_TENANT_ID",
366374
api_key="YOUR_API_KEY",
367375
)
368376
@@ -401,6 +409,7 @@ async def update(
401409
from trophy import AsyncTrophyApi, UpdateAttributeRequestItem
402410
403411
client = AsyncTrophyApi(
412+
tenant_id="YOUR_TENANT_ID",
404413
api_key="YOUR_API_KEY",
405414
)
406415
@@ -445,6 +454,7 @@ async def get(self, id: str, *, request_options: typing.Optional[RequestOptions]
445454
from trophy import AsyncTrophyApi
446455
447456
client = AsyncTrophyApi(
457+
tenant_id="YOUR_TENANT_ID",
448458
api_key="YOUR_API_KEY",
449459
)
450460

‎trophy/admin/client.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from .metrics.client import AsyncMetricsClient, MetricsClient
1414
from .points.client import AsyncPointsClient, PointsClient
1515
from .streaks.client import AsyncStreaksClient, StreaksClient
16+
from .tenants.client import AsyncTenantsClient, TenantsClient
1617

1718

1819
class AdminClient:
@@ -23,6 +24,7 @@ def __init__(self, *, client_wrapper: SyncClientWrapper):
2324
self._metrics: typing.Optional[MetricsClient] = None
2425
self._leaderboards: typing.Optional[LeaderboardsClient] = None
2526
self._streaks: typing.Optional[StreaksClient] = None
27+
self._tenants: typing.Optional[TenantsClient] = None
2628
self._points: typing.Optional[PointsClient] = None
2729

2830
@property
@@ -68,6 +70,14 @@ def streaks(self):
6870
self._streaks = StreaksClient(client_wrapper=self._client_wrapper)
6971
return self._streaks
7072

73+
@property
74+
def tenants(self):
75+
if self._tenants is None:
76+
from .tenants.client import TenantsClient # noqa: E402
77+
78+
self._tenants = TenantsClient(client_wrapper=self._client_wrapper)
79+
return self._tenants
80+
7181
@property
7282
def points(self):
7383
if self._points is None:
@@ -85,6 +95,7 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper):
8595
self._metrics: typing.Optional[AsyncMetricsClient] = None
8696
self._leaderboards: typing.Optional[AsyncLeaderboardsClient] = None
8797
self._streaks: typing.Optional[AsyncStreaksClient] = None
98+
self._tenants: typing.Optional[AsyncTenantsClient] = None
8899
self._points: typing.Optional[AsyncPointsClient] = None
89100

90101
@property
@@ -130,6 +141,14 @@ def streaks(self):
130141
self._streaks = AsyncStreaksClient(client_wrapper=self._client_wrapper)
131142
return self._streaks
132143

144+
@property
145+
def tenants(self):
146+
if self._tenants is None:
147+
from .tenants.client import AsyncTenantsClient # noqa: E402
148+
149+
self._tenants = AsyncTenantsClient(client_wrapper=self._client_wrapper)
150+
return self._tenants
151+
133152
@property
134153
def points(self):
135154
if self._points is None:

0 commit comments

Comments
 (0)